I know this has been covered many times already, but in case this is helpful for anyone, here’s how to get PHP4 and PHP5 running alongside in no time. It presumes your are running PHP on Windows and that your current PHP4 install is running of Apache 1.3.x:
1. install apache2 via installer
2. download PHP5 zip package and copy php files to C:/php5
3. copy php5ts.dll to C:/Program Files/Apache Group/Apache2/bin
4. copy the following lines into httpd.conf:
LoadModule php5_module “c:/php5/php5apache2.dll”
AddType application/x-httpd-php .php
PHPIniDir “C:/php5”
5. rename php.ini-dist to php.ini and leave it in C:/php5
6. add index.php to the DirectoryIndex directive
7. copy C:/php5/libmysql.dll to C:/WINNT/system32
8. in php.ini, uncomment
;extension=php_mysql.dll
making sure that your extension dir is set correctly:
extension_dir = “C:/php5/ext”
Start Apache2 and you’re in business. If you want to go back to PHP4, stop Apache2 and start your old Apache. If you set the document root the same for both installs, then you can run your old code on PHP5 without any adjustments and see what works 😉