PHP5 CGI parallel to PHP4 module on Windows

I was looking for a way to have both PHP4 and PHP5 running on Windows. So there was a bit of adaption of the note made by seric [1] to the Windows environment (Installation/PHP5). PHP4 still works as Apache module while PHP5 runs as CGI on a port-based virtual host:


Listen 83
<Virtualhost _default_:83>
ServerName localhost
ServerAdmin me@localhost
DirectoryIndex index.html index.php
ErrorLog logs/error.log
# http://httpd.apache.org/docs-2.1/mod/core.html.en#limit
<Location />
<Limit CONNECT>
Order allow,deny
Allow from all
</Limit>
</Location>
DocumentRoot \"C:/www/project-a/\"
ScriptAlias /cgi-bin/ \"C:/php5/\"
Action php5-script /cgi-bin/php-cgi.exe
AddHandler php5-script .php .html
</Virtualhost>

The downloaded PHP 5.0.0RC1 zip package has been unpacked to c:\\php5. Then I renamed the php.ini-dist to php.ini and restarted Apache.

[1] http://seric.cowiki.org/17.html

Leave a Reply