Server Fault is a question and answer site for system and network administrators. 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

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?


share|improve this question

marked as duplicate by Chopper3 Jul 29 '11 at 11:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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:

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.

share|improve this answer

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.
share|improve this answer

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