Category: server admin

PHP 4 and 5 on IIS

6:09 pm on February 18th, 2009, by Andy Tawse

PHP 4 should be long dead, but one of the reasons it isn’t is surely that it can be hard to have 4 and 5 installed on the same server. If you upgrade to 5, you then have to make sure all your PHP sites are still working. And who has time for that?

I’ve managed to get 4 and 5 working together on IIS 6 (Server 2003). It wasn’t easy to figure out how, but it’s easy to repeat. The key points are:

- PHP 4 as an ISAPI.

- PHP 5 running under FastCGI. FastCGI is better than old CGI and MS seem to have put in a lot of work to make PHP run better on Windows under this.

- Break with “best practice” and put your PHP 4 php.ini in c:\windows.

- Keep your PHP 5 php.ini in your PHP 5 directory.

- Put both PHP directories in your PATH.

Now you can start new sites in PHP 5 and migrate your old ones at your leisure.

Comment » | php, server admin

Back to top