PHP4, IIS6 and 64-bit Windows 2003 Server

If anyone had asked me how to put these three things together a week ago, I would have cringed; my next reaction would be to suggest upgrading to PHP5, using Apache, and one flavour or another of Linux.  Unfortunately that wasn’t possible at this point so, armed with the usual developer tools (that is, the F1 key and Google), I set out to get things set up… after all, how hard could it be?

While I’m sure I didn’t say that last bit out loud, I must have tempted fate as I spent the next day or so spouting obscenities at my poor computer whilst flitting about the internet looking for solutions to one problem or another.  My first suggestion is that you read the instructions in the PHP manual thoroughly; I glanced over them filled with false bravado based on having installed it on Apache many times, but didn’t really take note of the specifics.  This proved to be my downfall, as points five and nine of the general considerations were especially important.

Once everything had been done, though, it still didn’t work – requests just resulted in a 500 error code.  After investigating the issue, I found that (on some machines) installing a particular version of ActivePerl on a machine can break IIS.  This is because it adds an application mapping for the “.plx” file extension, but doesn’t enter an executable path; and this just breaks the server.  Since I didn’t need to be able to serve these files, I deleted the mapping and this made everything work.  If you do need to serve this sort of file then I would imagine that entering the appropriate path in the mapping would also solve the problem.

So, I hope that helps someone.