From: rbnsjnr at gmail dot com
Operating system: Linux-3.2.21 Debian/Wheezy
PHP version: 5.4.4
Package: MySQL related
Bug Type: Bug
Bug description:localhost x 127.0.0.1
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:~$
--
Edit bug report at https://bugs.php.net/bug.php?id=62390&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62390&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62390&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=62390&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62390&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=62390&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62390&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=62390&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=62390&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=62390&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=62390&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=62390&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=62390&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=62390&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62390&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=62390&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62390&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=62390&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=62390&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=62390&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=62390&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=62390&r=mysqlcfg