Development of PHP on Windows

I never really thought of PHP not running on Windows.  Before I had ever run it on windows it was just a Unix tool to me.  Recently I was reminded of the dismal performance it had on windows in years past during a resent webcast. Admittedly, if you used Windows+PHP for anything past development you were asking for trouble until about a year ago.  Sure Fast-CGI made a difference, but there were always little snags.  The community seemed to be stressed at some points porting extensions to windows. From my perspective, things seem to have improved.

There are quite a few I know of now that develop on Win and host on Linux.  For those I have two tips:

  1. Always use a forward slash (‘/’) in path names.
  2. Never ignore case.

The reason for #2 is that you will be very frustrated with things not working on a Unix server if you are lazy and ignore case.  If you keep both these points in mind you can easily build PHP applications on any OS and have them run with no code changes on the other platforms.  This is true if you want to support multiple OS or RDMS.  Because the setup you are using could be case insensitive, you could forget the importance of case sensitivity.

Then, as Ruslan Yakushev pointed out, some extensions are simply meant for Linux and are not practical to port from there.  Sometimes when they are ported their effective ness is limited because of the original code taking advantage of specific Linux features.  Enter the WinCache extension.  WinCacheis APC’s win32 sibling.  It offers completely parallel functionality to APC while taking advantage of Windows specific features.  This is very interesting to me since a subset of the framework I work on focuses on exploiting Windows platform functionality.  The implementation of WinCache seems to be well thought out since it makes moving between it and APC dependent code relatively painless.  It seems that Joomla, Drupal, and Sugar have been early adopters.  I also hear rumors of WordPress patches and Zend Framework back-ends.

Beyond op-code caching, WinCache offers enhancement in file caching, resolve path caching and a session save handler.  These seem to target a much needed performance gap that isn’t answered by simply switching to IIS on Windows.  PHP applications on Linux have benefited from this sort of acceleration for ages. In fact, several applications I have written that were heavy in file system operations were unable to leave the Linux wildlife reserve.

As I move forward with projects like Dante Job Scheduler, it is good to know I wont hit any hindrances like second-rate op-code cache performance.  This may have been a showstopper in the past, but as far as I can see, there are no more excuses for not using PHP.  Leave your server OS choice to your Server Administrator and build great web apps!

Development of PHP on Windows

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s