Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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.

2 Answers 2

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.

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.