Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple PHP versions on the same box

Is it possible to have multiple versions of PHP running on the same box ( like rails ) . Here is my problem , I need to start development on a new project and was planning to use PHP 5.3 for it so that I can use the latest Zend framework and active record with it .
However the machine where I need to host my application has PHP 4.4 and there are several other applications hosted there . I do not want to upgrade the PHP version on the server as in the past I have faced a lot of issues while upgrading the PHP version and deprecated functions .
I was wondering if it is possible to have multiple version of PHP on the same box and then somehow specify the version that you want your application to load ( similar to rails )

like image 992
NM. Avatar asked Dec 15 '09 06:12

NM.


People also ask

Can I have 2 versions of PHP installed?

Add a PHP Repository By default, Ubuntu 20.04 ships with the PHP version 7.4. So you'll need to add the PHP repository in your system to install the multiple PHP versions. Once the repository is up-to-date, you can proceed to install multiple PHP versions.

Can you run multiple versions of PHP at the same time?

Yes we can run several versions of php. To do that we must have to check the INSTALL file, if it is included in PHP source distribution.


1 Answers

Yes, it is possible. In fact, many servers operate this way. You may see .php4 and .php5 extensions from time to time indicating which version that particular script should be handled with.

ServerFault addressed this question

Running php4 and php5 along side each other

like image 132
Sampson Avatar answered Oct 15 '22 08:10

Sampson