ID: 45150 Updated by: [EMAIL PROTECTED] Reported By: conor dot kerr_php at dev dot ceon dot net -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: Windows Vista PHP Version: 5.3CVS-2008-06-02 (snap) New Comment:
Hi, mysqlnd uses the PHP streams, compared to libmysql, which does the network i/o itself. Thus, if mysqlnd can't resolve localhost to 127.0.0.1, then PHP should not be able too. Could you try to reproduce that. mysqlnd does nothing special, just uses IPv4 to open a TCP connection. Previous Comments: ------------------------------------------------------------------------ [2008-07-18 16:54:54] conor dot kerr_php at dev dot ceon dot net Hi, Finally got this sorted. Took a more methodical debugging attitude to this and reduced the mysql.connect_timeout to 5 seconds. Started to get error messages at last - so the mysql_connect function that wasn't failing altogether. Quickly determined that on Vista SP1, PHP5.3 can't resolve "localhost" to "127.0.0.1" in the mysql_connect function. Stopping Apache, pointing LoadModule php5_module ... and PHPIniDir ... back to 5.2.x then restarting Apache allows the mysql_connect function to work again (as expected). This is using a stock hosts file on Windoze, which is correctly set up for localhost. I'm not sure where the bug is but could it possibly be something to do with IPv6? Does PHP5.3's new mysqlnd default to using IPv6 first which then isn't resolving properly to 127.0.0.1? I only ask that as 5.2.6 works perfectly on the same machine(s) and the only difference I can see is the use of mysqlnd. I could be barking up the wrong tree altogether though, but I can confirm that PHP5.3.x can't resolve localhost when connecting to MySQL on Vista whereas it can on XP and 5.2.6 never has any troubles on the same machines (without any reboots). Also, FYI, hadn't tried this procedure before because command line commands to mysql work using "localhost" as well as "127.0.0.1" (as would be expected if Apache+PHP5.2.6 also worked) so it never occurred that there could be problem resolving localhost. At least I've got a solution for anyone out there... replace "localhost" with "127.0.0.1" in your scripts... until anyone @php.net can help us out with a fix/answer of course! Thanks again Jani for the post, it at least encouraged me to try and debug this more methodically and now I don't have to reboot into OSX or XP or upload scripts to a Linux server to out the new namespace functionality! :) All the best.. Conor Kerr http://ceon.net ------------------------------------------------------------------------ [2008-07-18 07:46:35] conor dot kerr_php at dev dot ceon dot net Thanks for replying! I've disabled all the security checks as this is a development machine so that can't be it. :( I haven't come across a single person trying 5.3 (via Apache) and the new MySQL extension out on a Vista machine.. can anyone please confirm that they have it working? ------------------------------------------------------------------------ [2008-07-13 15:05:56] [EMAIL PROTECTED] Are you sure it's not some "security" feature in Vista that is blocking the connections? I'd check firewall settings, etc. ------------------------------------------------------------------------ [2008-06-13 14:09:03] conor dot kerr_php at dev dot ceon dot net Hi, Has anyone taken a look at this? I've managed to get PHP5.3 working fine with MySQL on Mac OS X, Linux (RedHat 9 - old I know but anyway :) ) and Windoze XP but mysql_connect times out on any Windoze Vista system. If anyone has got 5.3 working with MySQL on Vista could they please e-mail me to say so. If not, could this be looked at soon? Thanks, Conor ------------------------------------------------------------------------ [2008-06-02 16:46:50] conor dot kerr_php at dev dot ceon dot net Description: ------------ I've been trying the PHP 5.3.x snapshots out for the past two weeks on three separate Vista systems and consistently got timeouts when a mysql_connect function was encountered. Tried rebooting into Windoze XP on one of the systems and installing on it and everything worked perfectly straight away. Tried everything I could on the Vista systems, removing all copies of libmysql.dll from the system, changing the PATH, removing the path, (restarting after all changes) but every time PHP the mysql_connect function times out. Are the snapshots tested on XP only? I've spent almost a full working day over the past two weeks trying to get 5.3 running in my normal environment so that I could start using the namespace functionality. Sadly I now have no choice but to use XP anytime I need to run anything I write as 5.3 clearly isn't compatible with the combination of Vista and MySQL. :( Any PHP script that doesn't use MySQL works fine on all three Vista systems. Reproduce code: --------------- <?php print "connecting..."; mysqli_connect('localhost:3307', 'root', ''); ?> Expected result: ---------------- No errors. :) Actual result: -------------- Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3307) in C:\Program Files\Glossword-WAMP\htdocs\test8.php on line 3 Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Program Files\Glossword-WAMP\htdocs\test8.php on line 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45150&edit=1