Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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

share|improve this answer
add comment

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
add comment

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 libphp5.so(for apache 2.2) in /usr/local/php-5.x
  4. In apache config write :

LoadModule php5_module "/usr/local/php/libphp5.so"

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.