ID: 50172
Comment by: avivahl at gmail dot com
Reported By: erik at navhost dot com
Status: Assigned
Bug Type: MySQL related
Operating System: win32 only - Win. Server 2008 R2
PHP Version: 5.3.1RC4
Assigned To: mysql
New Comment:
This bug still exists in the final 5.3.1 release. :-(
Reproduced here using Windows 7 w/ IIS 7.5 (FastCGI is used w/
Non-Thread-Safe php).
The workaround suggested by erik (editing hosts file) works for me.
Btw, PHP 5.3.0 (final) did not have this issue.
Previous Comments:
------------------------------------------------------------------------
[2009-11-18 22:54:54] carsten_sttgt at gmx dot de
> So I guess this is a windows bug rather than PHP?
No, it's a bug in the PHP stream transport. (mysqlnd is using PHP
streams for the connection)
-->
If PHP is asking the OS for the IP for the host "localhost", it gets a
list with 2 addrinfo structures (one for ::1 and the other for
127.0.0.1), but PHP is only trying a connection to the first one. Well,
the MySQL server don't know IPV6, and thus the connection fails.
Regards,
Carsten
------------------------------------------------------------------------
[2009-11-14 20:07:21] erik at navhost dot com
A simple workaround is to uncomment/add this line to the host file:
127.0.0.1 localhost
Worked for me.
------------------------------------------------------------------------
[2009-11-14 16:39:41] pajoye@php.net
I mean Bug #45150. But it looks like you may have met another issue.
Assigned to the mysql team so they can for more details.
------------------------------------------------------------------------
[2009-11-14 15:58:37] erik at navhost dot com
Looking into it further, the comment from pajoye fixes the issue in the
vista-based Server 2008. However, Server 2008 R2 is based on Windows 7
and introduces a new feature on the resolving localhost... see from the
hosts file:
"localhost name resolution is handled within DNS itself."
So I guess this is a windows bug rather than PHP? I can't see an easy
solution here either way.
------------------------------------------------------------------------
[2009-11-14 04:06:39] erik at navhost dot com
I can't seem to find the report you're referring to, but the issue
still stands. Is it a IPv6 related issue?
The ::1-line in the hosts file is already commented out.
------------------------------------------------------------------------
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/50172--
Edit this bug report at http://bugs.php.net/?id=50172&edit=1