I want to run two versions of PHP i.e 5.6 and 7.0 on the same machine. Please help me so that I can run my separate websites on separate versions.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I think that both these versions of PHP can be used simultaneously via mod_suphp apache module. I’ve successfully done this a couple years ago on CentOS 5 + PHP 5.2 with PHP 5.6.
Please can You found a solution, in my case I’d like to make both php5 and 7 run in apache2 for separate app. Any help :/
This can be done on Ubuntu using a PPA which offers 5.6, 7.0, and 7.1, though I’m not seeing a repo that has all versions of PHP available for CentOS right off.
Without a repository to support multiple installations to different directories, you’d need to compile PHP manually and define the directories.
On Ubuntu 16.04/16.10, this would be as easy as:
add-apt-repository -y ppa:ondrej/php
apt-get update
You can now search available PHP packages using:
apt-cache search php5.6
apt-cache search php7.0
And then run:
apt-get -y install php5.6 .....
Where php5.6 ..... would be a list of PHP packages you wish to install.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.