Windows 7 + IIS 7.5 + php 5.3.1 + MySQL 5.1: no good combination
I recently installed Windows 7 on my laptop. I also configured IIS 7.5 on it, installed php 5.3.1 and MySQL 5.1.
Everything seemed to be installed correctly: I could see the IIS 7 Welcome screen, I could look at the php configuration with phpinfo() and I could see the MySQL tables using the MySQL Administrator GUI.
But when I tried to use phpMyAdmin, I got stuck: after trying to load the homepage of phpMyAdmin for 20-30 seconds, I got an HTTP Error 500. I searched the internet for hours, trying to find somebody with a similar experience, but I did not find any valuable resources.
Even a very simple test-script like
<?php
echo "#1. Try to connect to mysql server...";
mysql_connect("localhost", "username", "password") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
generated a HTTP 500-error, after a 20-30 seconds wait.
Eventually, I decided to look at what I had installed when I was still using Vista. The difference seemed to be php: on my previous system, php 5.2.10 was installed.
I finally uninstalled MySQL and php 5.3.1, and then reinstalled php 5.2.11 and MySQL 5.1.41. That combination seemed to work without issues.
Conclusion: IIS 7.5 + php 5.3.1 + MySQL 5.1 does not seem to be a workable solution (for now). Stick to the 5.2-branch of php if you want to use it on Windows 7/IIS 7.5.
This entry was posted on Saturday, November 28th, 2009 at 22:41 and is filed under IIS, MySQL, php, Uncategorized, Windows 7. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
December 10th, 2009 at 22:44
Jeremy says:You are absolutely right … I spent the best part of a day banging my head against iis internal server error… thanks I just reinstalled the old 5.2.11
December 11th, 2009 at 14:36
Bramus! says:Just encountered the same issue. Please vote on the bug report at the PHP Bugs site to get it fixed in 5.3.2: http://bugs.php.net/bug.php?id=50290
B!
December 14th, 2009 at 22:11
Chris says:Im so glad I finally stumbled upon your blog! Ive just spent like 3 hours gradually getting more frustrated over this
Glad to know its not only me!
December 15th, 2009 at 18:55
Chris says:I have found out this bug is due to DNS resolution for localhost on Windows 7 (Server 2008 R2) based machines.
Uncomment 127.0.0.1 in your Hosts file! It fixes it
December 16th, 2009 at 21:48
Dan Thompson says:@Chris you sir, are the man! Great find.
December 26th, 2009 at 05:51
enigma says:thx a lot, you saved my day… or night:)
January 13th, 2010 at 21:51
ef says:Already spent a night on this trying to reinstall php, mysql, playing with extensions, etc. to be clear, the HOSTS file is [typically] at “c:\windows\system32\drivers\etc\hosts”. you’ll need to open it in notepad with administrative privileges and remove the ‘#’ before the line 127.0.0.1 localhost. Thanks again chris for figuring this out!
January 16th, 2010 at 04:48
Mikey says:You mean i’m not the only one?! I wish I stumbled onto this a few hours ago (>.<) If you edit the “c:\windows\system32\drivers\etc\hosts” file it fixes it. Thanks!!!!
January 23rd, 2010 at 22:12
Phaethon says:Thanks for providing the clue to this problem.
MySQL 5.1.41 on Vista w/ IIS7.0
I upgraded PHP 5.2.something to 5.3.1 and MySQL access ground to a (near) halt.
My host file looked like this:
127.0.0.1 localhost
::1 localhost
I commented out the /second/ line and that fixed it for me.
January 26th, 2010 at 17:33
Chris says:No Problem to those that have thanked me, I found this information on the PHP site in the bug reports!
January 27th, 2010 at 01:09
Jared M says:Wow…. I have to say after hours of USELESS information including but not limited to “edit the time zone in php.ini” I found the fix on your blog!
I did the same thing, Server 2008, however I commented out the ::1 entry, and everything works fine now. I was dreading having to backup/restore my blog, forums, and music server all to do a fresh install.
You are my favorite person of the day.
February 17th, 2010 at 17:09
David Holmes says:Ha wish I had googled this 3 hours ago but like others was being stubborn. I love you all and the tinterweb. Now back to some lavish php coding.
February 22nd, 2010 at 11:23
Jonathan Dubman says:I went through the same process and the same frustration, but this post saved my day! Thank you, thank you!!!
March 1st, 2010 at 00:05
Kresten says:So, so, so wish I’d read this a week ago. Would have saved me long nights and an angry wife…
Thumbs up, Chris!
September 23rd, 2010 at 00:54
Karl says:Thanks Chris… was about to go home and be up all night thinking about it. Now I will get a good night sleep
September 25th, 2010 at 20:25
evillen says:Thank Goodness I came across this – I’ve spent the last 5 hours installing and uninstalling PHP, MySQL and setting permissions for IIS.
If anyone is googling for problems with installing Joomla with mySQL on Windows 7 or IIS 7.5 then this is it….
October 4th, 2010 at 23:21
Dave says:Ok, I have the same issue. Uncommented both lines in the hosts file but I am still getting the ERROR 500. Running MySQL 5.1.41 and php 5.2.14 installed using IIS web platform installer and the Fast CGI module.
I am going out of my mind as this is the only place I have been able to find something decent on the issue but the reported fixes here are not working for me. Do I need to get rid of the current install and start again?
Cheers