We currently have a Windows web server. It's running Apache and PHP as a module. The server itself is a beast but PHP performs poorly in a Windows environment when installed as an Apache module and we're experiencing this first hand.

Anyway, this weekend I plan to reconfigure the server for a FastCGI installation instead and I was going to use IIS7 instead of Apache. Here's the problem though, we have a lot of sites setup with .htaccess files laying around and we weren't interested in cleaning these up to make the sites work properly on IIS.

My question is, does anyone know if PHP installed as FastCGI on Apache has comparable speed to IIS? You can read all over the web how amazingly fast PHP on IIS is, but now we're considering staying with Apache for an easy transition.

If Apache isn't going to be a good option then I guess we'll do the IIS route and just fix up the broken sites, but we kind of want to avoid this if Apache will give us comparable performance using Fast-CGI.

What do you think?

  • Have you considered doing this in a test environment first? that would answer a lot of your questions, I think.
    – Joel Coel
    Jul 13 '12 at 21:40
  • Of course! Planned to do that tomorrow. I just wanted to see what the opinions on serverfault was. Jul 13 '12 at 22:31

After bench-marking, mod_php was by far the fastest with mod_fcgid being a very close second.

IIS was slower than Apache by a noticeable difference.

If anyone is hitting this from Google search, our slowness problem was due to our database connection using localhost rather than Starting in Windows Server 2008, localhost is no longer in the hosts file (commented out) and instead is resolved through the DNS resolver which is apparently pretty slow.


IIS is far more secure than Apache on Windows. Check out what user Apache would run PHP as, and how much is isolated. And then check it out with IIS. Also, you can compile this code with Phalanger, which is quite nice for tests.

  • At the moment we aren't too concerned about the security differences between IIS and Apache as this server doesn't face the internet. I'm mainly concerned about speed. I'm going to setup both and benchmark them myself I think. Jul 16 '12 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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