PHP Classes

Warning: mysqli::mysqli() [mysqli.mysqli]:

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement a PH...  >  All threads  >  Warning: mysqli::mysqli()...  >  (Un) Subscribe thread alerts  
Subject:Warning: mysqli::mysqli()...
Summary:Can't connect MySQL server through socket '/var/lib/mysql/mysql.
Messages:15
Author:Karl
Date:2015-07-28 16:43:07
 
  1 - 10   11 - 15  

  1. Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Karl Karl - 2015-07-28 16:43:07
Warning: mysqli::mysqli() [mysqli.mysqli]:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
in /www/htdocs/mysqli_oauth_client.php on line 25

OAuth client error
Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

the data of the Connection is inserted

  2. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-28 20:51:40 - In reply to message 1 from Karl
You need to tweak the database connection options in your script to match your MySQL server configuration.

It seems the server socket is not right. You can fix that to the correct path if you know it, or put this in socket value:

ini_get("mysqli.default_socket")

  3. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Karl Karl - 2015-07-29 00:23:35 - In reply to message 2 from Manuel Lemos
I found the solution

'socket'=>''

in mysqli_login_with_google.php
and your solution is running.

the next error was I can't create an Object
with $clients = new stdClass();
$clients->socket = ini_get('mysqli.default_socket');
and then using

'socket'=>$clients->socket

I had a look through all the three zip classes and their files.
I like to code only in php 5 but most classes are in php 4.
Mostly they have a return at a false place as my php IDE says
or a return is missing.
(return always at the end of the function inside the class
and only one return)
The var definitions are not up to date as you could use
private, public, protected and I guess the new autoload
will not run with this files.
Only one class in one file an other php IDE error.
How about single quotes and double quotes the next IDE error.
Do you thing an update to php 5 is possible, and if you
like to do that when it will be finished.

It is the first time as I see the class is up and running
within one or two hours. Therefore I had always Errors.



  4. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-29 01:23:02 - In reply to message 3 from Karl
There seems to be a misunderstanding. This OAuth class requires PHP 5.2 or else the json_decode and json_encode functions would not work.

The variable declarations is just a matter of style. They remained that way because the class is not new and in the beginning the class only required PHP 4. Still the variable declaration style does not affect the class functionality.

You should only access class variables that are documented. So you you should look at the documentation that exists to understand what each variable means and how to use it.

As for autoload, you can install this package and all dependencies with Composer. It will will set an autoloader for any classes that you need.

The examples just do not use Composer autoloader because not all users know how to use Composer. But you can read more about it here:

phpclasses.org/blog/post/221-Speedu ...

phpclasses.org/blog/post/236-PHP-Co ...

  5. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Karl Karl - 2015-07-29 02:16:40 - In reply to message 4 from Manuel Lemos
I guess it is a misunderstanding, my requirements
are at least php 5.4. I can't use this classes.
At the Moment I am at the Point to go over to
php 5.5 as a minimum requirement.
In my Country most Hosting only using php 5.4,
5.5 and 5.6, with a Minimum requirement of php 5.4.
I am old fashion.
The php 5.4. Version should be finished until end
of August.
The matter of style is important, as I think if
you choose an other style all that handles that
can't be done in the past are very easy if you
modify the style.
This is why my requirments are at least php 5.4.
to use the Facebook, Google and co API.
I tried that in the php 5.2. and php 5.3. style
but it is not working.
I know in some foreign countries they use php 4.
But we will have no Hosting and Server with php 4.
I had a look at the documentation, and now I think
if I will use this class I have to write a new own
documentation and rewrite it in php 5.4. or php 5.5.
I guess this is a Long time to do.

Not all Servers have ssh available, that is recommended
for Composer. I tried it with system in php or other
code snippets to get the Composer working for me, but
it is not working. Same with installing phpunit and other
testing Environments and IDE's and phar's.

That is the point I could read a lot of things, but I need
fast and easy solutions as I won't find them. The php 5.4
should be finished at the end of August, but I guess I am
reading until Christmas.

If I will code in php 5.2. it won't run, and I have to use the
ioncube to hide the bad old php code.
But i will have a look at the Composer sites, I hope I will
find something usefull.
Thanks a lot, a great class, but to old for me.


  6. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-29 02:43:40 - In reply to message 5 from Karl
The OAuth class can work with PHP 5.2 or higher. 5.2 is the minimum, not the maximum PHP version it supports.

I use it here with PHP 5.4 but it works with later versions.

  7. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Karl Karl - 2015-07-29 19:38:20 - In reply to message 6 from Manuel Lemos
This will possible, but it is not as requested.

  8. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-07-29 20:23:26 - In reply to message 7 from Karl
I am not sure what you mean. Doesn't the class work in the PHP version you are using?

  9. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Karl Karl - 2015-08-01 17:38:38 - In reply to message 8 from Manuel Lemos
the Point is not if is working or not working, the
Point it have to be a php 5.4. class with actuall
code as requested by my customer.
The next Point is some things are incompatible and
I have to do and add some new functions.
The next Point this is only valid until September,
with beginning October my customer will request
strong php 5.5. code.
You could see at the bitExpert classes, no one
uses php 4 classes at this time.
At the Moment every year the classes have to be
updated to the next Version it is very fast.
this is only possible to do with some update
generators, or you should have a lot of coders.
An easy way is coding today php 5.4. classes
as php 5.6 classes, then the update is easy
and fast.
Or do you have other knowledge about migrating
classes fast and easy.


  10. Re: Warning: mysqli::mysqli()...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-08-01 19:45:01 - In reply to message 9 from Karl
I think there is a misunderstanding. As mentioned before this class requires features available only in PHP 5.2 or later. It does not use features of PHP 5.6 or later because those features are not necessary. But the class works flawlessly in PHP 5.6.

 
  1 - 10   11 - 15