Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to develop both on php 5.2 and on php 5.3. I need those two versions installed on my system and ability to switch fast between them.

One solution I found is to upgrade/downgrade everytime I need other PHP, but I would like solution that I could only switch one apache config file.

share|improve this question

You could very easily do this with PHP-FPM. Use two instances of it with different PHP versions.

share|improve this answer

The best thing to do would be to modify the apache configuration so that either special file extensions or special paths get executed by the different version modules.

You will likely not be able to install both separately using APT. I would install the most up to date php packages with apt, and compile the older version of php you want into a different path prefix, and a different apache module name.

share|improve this answer

Try this :

  1. Compile Both PHP say on location /usr/local/php-5.2 & /usr/local/php-5.3
  2. Create a symlink of required PHP at /usr/local/php -> /usr/local/php-5.x(Just remove and create symlink to swtich)
  3. And place the respective apache 2.2) in /usr/local/php-5.x
  4. In apache config write :

LoadModule php5_module "/usr/local/php/"

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .