For years now I’ve been spreading the word about how great PHP runs on Windows. In fact, my own blog runs on PHP on Windows. It also amazes me today the amount of closed minded individuals out there with established misconceptions around how PHP runs on Windows. This really all dates back to the early days when PHP and ASP would battle it and when Microsoft’s stand was “Why would you ever use PHP when you have ASP.NET available?” A few years ago Microsoft woke up and decided “if you can’t beat them join them” and began working with Zend.com to make PHP performance on Windows be on par with that on Linux. In my personal (albeit modestly biased) opinion, we’re there!
Today while reviewing my daily RSS feeds I came across a great blog post by Brian Swan “Why is PHP 5.3 on Windows faster than previous versions?”
That really lays out just why PHP 5.3 is faster:
- They moved to Visual C compiler 9 (a modern C compiler for windows) from Visual C compiler 6 (something developed 10 years ago and can probably be called a artifact of an ancient civilization in computer time).
- They moved from the POSIX API to the Win32 API: Native == Good!
- They rebuilt the core extensions / libraries. These were all reworked from the ground up to make sure they were optimized.
Now those are just the changes in PHP itself and by themselves they sound pretty good, no? But that’s just the changes in PHP core! Let’s look at IIS7 and what’s happening there:
- We got the FastCGI implementation for IIS – allowing us to execute CGI based programs much faster by reusing a single process over and over for each call of a PHP application instead of having to spin up a new thread every single time the app is called.
- We got WinCACHE – Providing us a PHP caching engine allowing us to cache PHP bytecode, the compiled version of a PHP script, in memory.
- Then we got IIS7 itself, Microsoft’s fastest web server today and argubly one of the fastest web servers available today.
So if you’re one of these guys that has drank the same old instant coffee crystals for years “Run PHP on Linux, ASP on Windows and never mix the two” then it’s time to walk over to the Kuerig and drop a pod in and savor the flavor of what modern technology has to offer. Oh and after you brew that cup of coffee, load a PHP application on Windows. Here’s a coupon to get you 6 months of PHP optimized Windows hosting, for free!