PHP on IIS compared to PHP on Apache

PHP Best Practices

Comparing PHP on WIMP and LAMP platforms. Focusing on details that would be helpful to a PHP developer who works with both platforms.

Date : 2009-06-04
Differences between PHP on WIMP and PHP on LAMP.

Linux seems like an obvious choice when developing PHP/MySQL applications but there are various reasons why someone would want to use a windows server to run PHP applications. Just one consideration is using 1 server to run several sites and being able to mix .NET and PHP development side by side. Regardless of the possible reasons for doing it it is fairly common to find PHP running on Windows servers with IIS. That being the case I wanted to draw attention to some of the differences you may encounter when developing with PHP on Win/IIS vs Linux / Apache.

The most obvious difference between WIMP and LAMP is definitely performance. For years there has been an obvious performance advantage of LAMP over WIMP. Only recently is their even a chance of closing that gap. There are currently 2 projects underway that may help.
Currently available is IIS7 which is reported to have had PHP performance enhancements built in with collaboration from the ZEND team.

An upcoming projects involves Microsoft engineers working with PHP engineers to get the next version of PHP (PHP5.3 which is not yet available at this time) to perform much better in IIS. This will no doubt make some progress toward WIMP catching up with LAMP in performance.

So, while comparable hardware running a LAMP platform will probably still outperform a similar WIMP platform in most ways that may not always be the case. I'm not sure a Windows server will ever catch up with Linux in stability but performance might get close.

Focusing on coding these 2 platforms I can say I have run into many differences in the specifics of how code is executed. If you get a site coded for PHP on Linux and just copy it over to an IIS directory and set it up there is very little chance that it will work as expected out of the box. There are usually at least some small tweaks necessary to get things working.

Over the years that I've worked with these issues I've never bothered to document them so I've started tracking them down now and researching what the differences are. Doing this I've started to find that some of the differences can be fixed simply with small PHP.ini changes. That being the case I've decided to extend my research in several directions. Articles will be posted with those results as I gather them.

Some of the areas I've started researching knowing there are differences:
Differences in PHP.ini settings
Differences in File System functions
More will be coming soon.
Check back to get more details.

Comments :

No comments yet
  • Search For Articles