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.

17 Comments

  1. 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

  2. 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!

  3. 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 πŸ™‚

  4. 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!

  5. 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!!!!

  6. 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.

  7. 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. πŸ˜‰

  8. 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.

  9. I went through the same process and the same frustration, but this post saved my day! Thank you, thank you!!!

  10. So, so, so wish I’d read this a week ago. Would have saved me long nights and an angry wife… πŸ™‚

    Thumbs up, Chris!

  11. Thanks Chris… was about to go home and be up all night thinking about it. Now I will get a good night sleep πŸ™‚

  12. 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….

  13. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.