You can install more than one version on the same server.
After installing the two versions of PHP, in Apache configuration, in httpf.conf
you can configure an extension for each version:
AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php # the default
It is also possible to make an entire folder use a specific version by changing .htaccess
, in the folder you want to run in a different version by specifying the desired version.
AddType application/x-httpd-php4 .php
Source:
link