Possible Duplicate:
linux: one apache two php versions. possible?!

I was asked in an interview.

How can we set up two different php version ex:php v 5.0 and php v 5.3 in a single machine?

Is it possible to do it with apache?

Thank

link|improve this question
feedback

closed as exact duplicate by Chopper3 Jul 29 '11 at 11:08

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

Yes just about, at least one needs to be compiled from source and installed to a different location (linux assumed) and you cannot run both as apache modules (mod_php/DSO) at the same time

Then you can run one as an apache module (DSO) and one as FastCGID and then in the vhost you configure what you want the site to use - note that i haven't gone through specific instruction steps for these - there is a good guide here if you are interested: http://www.metod.si/multiple-php-versions-with-apache-2-fastcgi-phpfarm-on-ubuntu/

I wouldn't really recommend it though as it does open you up to security issues of managing 2 seperate php installs, especially if one of them is an older version of php.

link|improve this answer
feedback

Sure, you can do it with something like this:

  • one version install from binary and the other compile from source (or different --prefix)
  • and configure one as Apache module and the other in CGI mode.
link|improve this answer
feedback

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