Emmanuel Istace
Emmanuel Istace

Reputation: 1249

Run php5 and php7 in parrallel

I have php5 and php7 applications.

The php5 application are not compatible with php7.

How can I run both runtime on the same apache server ?

Upvotes: 1

Views: 5080

Answers (3)

slevy1
slevy1

Reputation: 3832

If your operating system is ubuntu, then you can set up multiple instances of Apache, one to run PHP 5 and the other to run PHP 6 according to this article.

Upvotes: 1

user7236046
user7236046

Reputation:

You should be able to but you'll need access to the server, so shared web hosting is probably off limits. Have a look at this answer from another SO post. I believe that should apply here.

One way to do this is to have your main version of php set up with mod_php and run all of the others through fast cgi on different ports (i.e. 81, 82, 83 etc). This won't guarantee totally consistent behavior though.

Credit to Dana the Sane

So one version is done through CGI and the other is done as an apache module.

Alternatively you could look into upgrading your php5 code to be compatible for php7 as it'll make it more stable and secure. Albeit time consuming though.

Upvotes: 0

sumit chakraborty
sumit chakraborty

Reputation: 141

Essentially you need to use fastcgi.

You should look here for doing so:http://linuxplayer.org/2011/05/intall-multiple-version-of-php-on-one-server

Upvotes: 1

Related Questions