Not that I haven’t already been running PHP on Windows for years, but there’s hope on the horizon for finally having a stable CGI implementation of PHP under IIS. Check out the FastCGI project, which today released its Technical Preview 2 version. For Zend‘s part, they have a special build of PHP 5.2/Zend Core optimized for FastCGI. I need to crank up a virtual machine to try this on, but in concept it sounds promising.
3 thoughts on “Finally (Maybe) a Good Way to Run PHP on Windows”
Why not just use a WAMP Stack such as the Web-Developer Server Suite?
PHP as a module is very stable, with Apache, under Windows. Though if you must, you can still run at as a cgi.
This is certainly an option. Although I wonder why, in a production environment, once you’ve decided to go with WAMP, you wouldn’t just take the plunge and go LAMP (especially from a support perspective, although Iâ€™d have to dig into the interfaces and integration of WAMP a little bit to see if possibly it offers genuine advantages like active directory security, etc.). The current implementation of PHP on Windows is already “good enough” for developer, hobbyist, home hosting and even (probably) small business. I’ve have a pretty robust implementation running (and serving parts of this blog) under Windows 2000 for several years.
Aside from the promise of improvements in stability, security, etc., the main draw of FastCGI for me is that it runs under IIS. This allows one to bolt PHP on to an existing IIS-hosted web site (WISP?). At that point it becomes possible to run PHP side by side with .asp and .NET code in the same domain, on the same ports, etc. MySQL can also be added to this mix without a problem (again, Iâ€™m currently doing it–is this called WIMP?). My clients have asked for exactly these kinds of tightly-integrated hybrid solutions in the past, but Iâ€™ve hesitated to recommend or support same in a production environment. FastCGI seems to offer some hope.
Personally, I’m not looking for a second web server and second set of interfaces (although, arguably, on WinXP Pro, this is exactly what you do want, because of the port/host header limitations in PWS). For a development environment, where you only have a Windows machine but you want Apache running (possibly side-by-side with PWS/IIS), sure, go for it. In fact I did exactly this when I worked in a single-machine development environment at my last full-time job.
As I like to say, “develop and test on Windows, deploy on Linux.” Well, that and, “Windows is the path of least resistance.”
In my context, I build, test, and maintain my sites with the above Web-Developer Server Suite. Then I SSH (using PuTTY) into my VPS running CentOS, and upload the PHP files. Simple and effective.
Sure, I could ditch Windows and install Linux. But why would I do that? I have what I need. I’m just trying to be the most productive I can. And Windows is very easy.
And this is coming from someone that has had plenty of Linux exposure. Take the average end-user, remove Windows, install Linux, and you will have a mess on your hands. People do not like change. People are familiar with Windows. Why fight it? Go with the flow.