ID: 32081 Updated by: [EMAIL PROTECTED] Reported By: subscription at nazarenko dot net -Status: Assigned +Status: Closed Bug Type: MySQLi related Operating System: * PHP Version: 5CVS-2005-09-08 Assigned To: iliaa New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2005-09-10 22:57:47] [EMAIL PROTECTED] Assigning to Ilia who supposedly fixed something like this before.. ------------------------------------------------------------------------ [2005-09-08 07:57:02] subscription at nazarenko dot net As I specified it in my last comment, safe mode was off. What I am trying to say is that in all the testing scenarios the socket was never speified in a function call and the behaviour of mysqli_connect() and mysqli_real_connect() is not the same. mysql_connect() does use the mysqli.default_socket value and it does not matter if I specify user/password in a function call or not. mysqli_real_connect() never uses the mysqli.default_socket value, whether user/password are given in a function call or not. ------------------------------------------------------------------------ [2005-09-08 00:40:50] subscription at nazarenko dot net Sorry, you comment is not true. Both mysql*_connect functions, if called this way: mysql_connect('','user','password') mysqli_connect('','user','password') do use mysql*.default_host/mysql*.default_socket from the php.ini. See my example with mysqli_connect() above. It is ONLY mysqli_real_connect() called this way: mysqli_real_connect($db_obj, '', 'user', 'password') that does not use the values from php.ini. Just to dismiss the argument completely I have tried setting all mysqli.default_* parameters in the php.ini to proper values (safe mode off) and then calling mysqli_real_connect() this way: $db=mysqli_init(); mysqli_real_connect($db); I am still connection error and see that the mysqli_real_connect() is trying to use the hard-coded socket value, which is different from the php.ini ------------------------------------------------------------------------ [2005-09-07 13:48:21] [EMAIL PROTECTED] The defaults are only used if you don't pass any parameters to these connect functions. ------------------------------------------------------------------------ [2005-09-07 11:40:00] subscription at nazarenko dot net Tried the php5-200509070630 snapshot. The settings in the php.ini file are: error_reporting = E_ALL display_errors = On mysqli.default_socket = "/srv/mysql/mysql.sock" mysqli.default_host = localhost Used this code for testing: <? $db = mysqli_connect('','user','password'); var_dump($db); close ($db); echo "---------------------------\n"; $dbr = mysqli_init(); var_dump (mysqli_real_connect ($dbr, '', 'user', 'password')); mysqli_close($dbr); ?> This produces the following ouput: object(mysqli)#1 (0) --------------------------- Warning: mysqli_real_connect(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) bool(false) So it confirms that mysqli_real_connect() is still ignoring the php.ini setting. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/32081 -- Edit this bug report at http://bugs.php.net/?id=32081&edit=1