From: gert-rainer dot bitterlich at ima-dresden dot de Operating system: Windows 7 64bit PHP version: 5.3.1 PHP Bug Type: MySQLi related Bug description: Database connect error
Description: ------------ The connect to the MySQL database (V5.1.x) faild with PHP 5.3.1 (also with PHP 5.3.2RC1), when I use a real servername, like localhost or the PC name. If I use the IP address it works fine. With PHP 5.3.0 it was OK. Reproduce code: --------------- <?php $sHost = 'localhost'; echo'<pre>Host = '.$sHost.'</pre>'; $link = mysqli_init(); if (!$link) { die('mysqli_init failed'); } if (!mysqli_options($link, MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) { die('Setting MYSQLI_INIT_COMMAND failed'); } if (!mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 5)) { die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed'); } if (!mysqli_real_connect($link, $sHost, 'root', 'xitami', 'kb_globals')) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } echo 'Success... ' . mysqli_get_host_info($link) . "\n"; mysqli_close($link); ?> Expected result: ---------------- Host = localhost Success... localhost via TCP/IP Actual result: -------------- Host = localhost Warning: mysqli_real_connect() [function.mysqli-real-connect]: [2002] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle na (trying to connect via tcp://localhost:3306) in D:\Inetpub\wwwroot\php\test\test_mysqli.php on line 20 Warning: mysqli_real_connect() [function.mysqli-real-connect]: (HY000/2002): Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. in D:\Inetpub\wwwroot\php\test\test_mysqli.php on line 20 Connect Error (2002) Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. -- Edit bug report at http://bugs.php.net/?id=50992&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50992&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50992&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50992&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50992&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50992&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50992&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50992&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50992&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50992&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50992&r=support Expected behavior: http://bugs.php.net/fix.php?id=50992&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50992&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50992&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50992&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50992&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50992&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50992&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50992&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50992&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50992&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50992&r=mysqlcfg