The other day, during a meeting with a potential customer, I was asked “Would you really recommend running PHP on Windows?” This was after I had expressed my intent to build on existing infrastructure, no matter what the language or OS. This question struck me since I never thought about it in the sense of a ‘recommendation’. Most the time I haven’t been involved until after the OS was chosen. Even when I was involved in the OS choice, thinking back, I don’t think that PHP actually fueled that answer. As I thought about it I realized that times have changed. In the 90’s I would have never recommended Windows as a web server. I also would not have recommended Linux or Mac as a desktop. Since then what has happened? Well, Windows 2k, OSX and Ubuntu… but, back to PHP and Windows. Often I get the feeling that PHP caries a negative stigma beyond the common ‘my programming language is better than yours’ attitude. Usually this is expressed by someone with limited or non-first-hand experience, or as blind loyalty to a Microsoft Partner agreement.
So should it make sense to host your PHP site on Windows? I have used Windows as my development desktop for some time. My reason was that windows was simply given the most gaming attention. A fact which admittedly has nothing to do with server OS. I will express my experience/perspective while you draw your own conclusions.
All platforms go through growing pains. Recently I have experienced that with ASP.NET MVC. In fact I have experienced similar negatives at one time or another on all platforms I use : Windows, Apple, Linux, BSD, Perl, PHP, Python, Java, C#, VB.NET… So I really don’t find myself in a ‘camp’ or as an ‘activist’ or ‘zealot’ since I am purely concerned with the outcome of the given task taking into consideration the ecosystem it needs to survive. Say I was a landscaper that preferred palm trees and someone asked me to put a tree at their Montana home. I could make one stand and maybe even grow for a time. However the tree would certainly not last past August.
I have been afforded the challenge of testing PHP in places I didn’t think it would grow. But like a yucca, you can find it in places you may not think likely. I have written windows services, servers and daemons using PHP. I have experimented with desktop GUI applications and have automated all kinds of administrative operations across all mainstream operating systems. Was PHP always the ideal tool for the job. Admittedly not. However it is conceivable that with a little attention, it could be quite a robust tool for any of those uses, and is quite ideal an many cases.
Perhaps this is why in ’07 cross platform compatibility seemed to become a front-seat concern for companies like Zend, who desired PHP reach its full potential on Windows. My greatest concern at the time was the simple non-existence of some extensions on Windows. The company I was working for was hosted on Linux at the time, and had gotten accustomed to some extensions. The local network admin had required Windows desktops which didn’t thwart our development using PHP. Never the less, there were shortcomings to this sort of practice at the time. Microsoft ans Zend addressed this. The solution to solidifying a platform’s foundation on an operating system is to get expert resources involved. I am happy to say that the WinPHP community is thriving and well today.
Given the attention that is being given to the platform running on Windows I suspect you will see more and more production sites being hosted on Windows and serving up things like WordPress and Dante and even more custom apps. The truth of the matter is that developing in PHP5 is quite enjoyable. The ease of bringing anyone from other OOP programing languages like Java and C# on board makes assembling teams much easier. The fact that PHP 5.3 enhances frameworks and support for Windows native APIs is gravy on the already tasty steak that is PHP. (apologies to the vegans)
So my recommendation: ignore out-of-date information on any subject. Do hands-on tests to see if it fits the methods and comfort level of your ecosystem. Don’t let OS dictate your programming language.