Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

PHP 5.3.2 Apache 2.2.15 Mysql 5.1.X Windows XP SP3

I have now configured everything correctly but get a timeout when trying to connect to Mysql via PHP. So frustrated.

I don't get an error message, the script just times out. I have made sure I have the correct paths.

Fatal error: Maximum execution time of 60 seconds exceeded

Any idea why this might be happening? I do a php -v from the command line and everything is normal, no errors.

i upgraded PHP from 5.2.6 to 5.3.2 - does there seem to be problems or bugs with this? I am essentially using my previous PHP.ini while editing paths. I am lost. Help!

If you need anything from phpinfo() or httpd.conf or php.ini let me know. else

share|improve this question
If you could just clear a few things up, that would be great. Is MySQL on the same box as Apache, or a separate database server? Are you using localhost or or your DB server (if appropriate) in your mysql_connect() function? Have you tried adding error_reporting(E_ALL) at the top of the script temporarily to see if that helps? – Ben Pilbrow May 20 '10 at 20:49
Also worth checking, can you connect to MySQL via the command line with the same username/password as your PHP script? – Ben Pilbrow May 20 '10 at 20:52
mysql is on the same box. development machine. I'm using localhost and it's included in my hosts directory in Windows/system32/... hosts file. I have PHP set to E_ALL in the INI. PHP works, connecting to mysql times out. port is 3306 in the php.ini and its set as so by mysql. – mcondiff May 20 '10 at 20:52
I can login using mysql command line – mcondiff May 20 '10 at 20:54
Have you tried specifying instead of localhost? Since upgrading my laptop to PHP 5.2.13, localhost has never worked when connecting to MySQL via PHP, even though I have it set up in my hosts file. I realise you're on PHP 5.3, but I imagine if it broke in 5.2, it might well still be broken in 5.3? – Ben Pilbrow May 20 '10 at 21:03
up vote 0 down vote accepted

With PHP 5.3.X + Apache 2.2.X on a Windows system it seems like one has to use as localhost. This has not been the case with PHP 5.2.X in my trials. I will continue using php 5.2 until I can fully figure out what I am doing wrong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.