From: david at ols dot es Operating system: Linux debian PHP version: 5.2.10 PHP Bug Type: MySQL related Bug description: misconfigured socket on php cli
Description: ------------ mysql_connect uses wrong socket Reproduce code: --------------- #!/usr/local/bin/php -n <?php $base="/usr/local/exim"; $lnk=mysql_connect('localhost','root','password'); ?> Expected result: ---------------- script must connect to mysql server Actual result: -------------- Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) echo "<?php phpinfo(); ?>" | /usr/local/bin/php -n | grep sock reports: MYSQL_SOCKET => /tmp/mysql.sock mysql.default_socket => no value => no value PHP compiled with ./configure --with-mysql --with-mysql-sock=/tmp/mysql.sock no default socket configured in php.ini Apache module version works ok, but same code executed wiht php cli seems to use a socket defined elsewhere -- Edit bug report at http://bugs.php.net/?id=49299&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49299&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49299&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49299&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49299&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49299&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49299&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49299&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49299&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49299&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49299&r=support Expected behavior: http://bugs.php.net/fix.php?id=49299&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49299&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49299&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49299&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49299&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49299&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49299&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49299&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49299&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49299&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49299&r=mysqlcfg