PHP 5.3 Windows Bug + Solution
Mar 31, 2010 · 1 minute readCategory: php
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
I don’t actually use windows but on the off chance that I might in the future for some reason I thought I would make a note of the solution here.
The problem can be spotted by getting this error message:
PHP Warning: mysqli::mysqli(): ```2002 A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in xxx.php on line 2 PHP Warning: mysqli::mysqli(): (HY000/2002): 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 xxx.php on line 2
The solution is this:
Edit your hosts file and comment out the Ipv6 line
[code]#::1 localhost ```