Installing PHP 4.x and PHP 5.x on the same server

The following instructions describe the process of installing both PHP 4.x and PHP 5.x in CGI mode on the same server:

1. Unpack PHP 4 distributive to "c:\php4" folder.

2. Unpack PHP 5 distributive to "c:\php5" folder.

3. Set "Read" NTFS permissions for "WSPWebUsers" group (or orther specified on WEB service properties page in WSP) on both "c:\php4" and "c:\php5" folders.

4. Rename "c:\php4\php.ini-recommended" to "c:\php4\php.ini".

5. Open "c:\php4\php.ini" for editing and change the following settings:

cgi.force_redirect = 0
extension_dir = "c:\php4\extensions\" 

6. Save "c:\php4\php.ini" and close.

7. Rename "c:\php5\php.ini-recommended" to "c:\php5\php-cgi-fcgi.ini".

8. Open "c:\php5\php-cgi-fcgi.ini" for editing and change the following settings:

short_open_tag = On
cgi.force_redirect = 0
extension_dir = "c:\php5\ext\" 

9. Save "c:\php5\php-cgi-fcgi.ini" and close.

10. In IIS manager under "Web Service Extensions" node add two new web extensions:

"PHP 4" with required file "c:\php4\php.exe"

and

"PHP 5" with required file "c:\php5\php-cgi.exe"

11. Set both extensions status to "allowed".

12. If you have previously installed PHP 4 or PHP 5, please, make sure you don't have a) any PHP libraries in "c:\windows\system32", b) php.ini in "c:\windows" and c) paths to PHP folders in PATH system variable.