views:

48

answers:

2

Hi,

I installed LAMP manually on Ubuntu, let's say my current version of PHP is 5.2 and I want to switch to PHP 5.3 for awhile, is that possible? No xampp solution please.

Thanks

A: 

The most hassle free way would be to run it as CGI instead of using mod_apache. Then you can run both simultaneously by simply changing handler .php with a .htaccess or in a vhost.

prodigitalson
How can I do that? Also I already have my lamp running, only need to do is to have another php version and make switch between them at a time.
Jebb
http://library.linode.com/web-servers/apache/php-cgi/debian-5-lenny#configure_apache_for_php_cgi Then install you other version of php in `/opt` or what have you. Then you add the necessary configs to the individual virtual hosts or set them up on the main host but using different file extensions - you default them to two seperate extensions and if you want a particular folder to run the default in a differnt version youd use an AddHandler in a .htaccess.
prodigitalson
+2  A: 

You can install them in something like /opt/php5.2 and /opt/php5.3 and then use update-alternatives to switch between the binaries.

Daniel Egeberg