If you are using apache, I can suggest how I solved this. Install different versions of PHP in different locations and prepare several apache php-xyzconf files, for example
ScriptAlias /php/ "path/to/php-5.2.10/" AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml Action application/x-httpd-php "/php/php-cgi" <Directory "/php/"> Order allow,deny Allow from all </Directory>
ScriptAlias /php/ "path/to/php-5.3.0/" AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml Action application/x-httpd-php "/php/php-cgi" <Directory "/php/"> Order allow,deny Allow from all </Directory>
etc., so you can quickly change the name of the included .conf file and restart the server. Or, like me, make several virtual hosts that have the same root directory, but with different versions of PHP:
<VirtualHost *:80> DocumentRoot "C:/www/localhost" ServerName local.php-5.2.10 Include conf/php-5.2.10.conf <Directory "C:/www/localhost"> Allow from All </Directory> </VirtualHost>
Slava Mar 14 '11 at 13:44 2011-03-14 13:44
source share