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

Is it possible to install 2 php versions on same server.

I have some old sites on my local system which supports php5.

But latest CMS and framework supports php5.3 . I don't want to change my old sites. But want all work perfectly.

So is it possible that I can install both versions or any other way to make workable all?

share|improve this question

migrated from Mar 13 '12 at 17:57

This question came from our site for professional and enthusiast programmers.

This is more of a serverfault question. – Crontab Mar 13 '12 at 16:41
Yes, it is possible, see here:… – Charas Override Mar 13 '12 at 16:42


You can use something like fastCGI or patch php-fpm for versions up to 5.2.x

For versions PHP 5.3.x < 5.3.3 you can get php-fpm from the php svn like this;

cd php-5.3.x (download and unzip php first)
svn co sapi/fpm
./buildconf --force
./configure --enable-fpm ...your other configure options, etc...
make && make install
  • After that you need to adjust the default config file (installed into $prefix/etc) and run "php-fpm".

(Instructions from

For php 5.3.3 and later php-fpm is included in the core. So the only thing you need to do is compile php with --enable-fpm, se more here.


Set up the different versions you need in different paths, and start them.


Then you can point your webserver to use different running php-processes depending on which php version you need.

share|improve this answer

It heavily depends on your web server. Apache for example has the concept of "handlers" which can be simply set to different values for your PHP files in the virtual directory configuration or within a .htaccess file like this:

 AddHandler php53-cgi .php

This way, you could set PHP versions per directory easily after you've defined the appropriate Action directives for different PHP versions.

share|improve this answer

Your Answer


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