|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-22 11:23 UTC] johannes@php.net
[2012-06-22 11:23 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
[2012-06-25 17:31 UTC] rbnsjnr at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ Dear (a) With PHP5.4.4 my projects do not connect more in the mysql database. I could not find answers on the Internet. The PHP5.4.4 is not connecting to the mysql database with the function mysql_connect () and the parameter "localhost". When using the parameter "127.0.0.1", this function connects without problem. See the example below that the error does not return PHP5.4.3 and PHP5.4.4 returns an error. Note: My PHP5.4.3 and 5.4.4 were compiled with the following parameters: --prefix=/opt/php-5.4.3 --with-apxs2=/opt/httpd-2.4.2/bin/apxs --with-mysql --with-pgsql=/opt/PostgreSQL/9.0/ --with-zlib --with-bz2 --with-openssl --with-kerberos --enable-calendar --enable-ftp --enable-intl --enable-soap --enable-sockets --enable-zip --prefix=/opt/php-5.4.4 --with-apxs2=/opt/httpd-2.2.22/bin/apxs --with-mysql --with-pgsql=/opt/PostgreSQL/9.0/ --with-zlib --with-bz2 --with-openssl --with-kerberos --enable-calendar --enable-ftp --enable-intl --enable-soap --enable-sockets --enable-zip Test script: --------------- <?php $con = mysql_connect("localhost","u_joomlades","u_joomlades"); if (!$con) { die('Could not connect: ' . mysql_error()); echo "\n"; } mysql_close($con); echo "\n"; ?> Expected result: ---------------- Replacing the parameter "localhost" to "127.0.0.1" the PHP5.4.4 connects without problems. rubens@debian:~$ /opt/php-5.4.3/bin/php bd.php rubens@debian:~$ /opt/php-5.4.4/bin/php bd.php rubens@debian:~$ Actual result: -------------- rubens@debian:~$ /opt/php-5.4.3/bin/php bd.php rubens@debian:~$ /opt/php-5.4.4/bin/php bd.php Warning: mysql_connect(): No such file or directory in /home/rubens/bd.php on line 3 Could not connect: No such file or directory rubens@debian:~$