By garthkiser
Hello all. I need to run different versions of PHP in different directories. For example in var/www/html I’d need to run the standard PHP 7.x and in var/www/html/xxxx I’d need to run PHP 5.x.
There are quite a few strategies for this described online, and other hosting/vps services directly offering the built-in ability, but after a day of experimenting with these strategies on digitalocean droplets, I’ve found none that have worked on digitalocean droplets.
So, if anyone is running different versions of PHP on different directories in digitalocean, then please, would you share your methods?
Thanks, Garth
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!
Hi @garthkiser,
It is possible to have two different versions of PHP co-installed, but it is probably not worth the pain if you have other options. I would suggest using separate Droplets if you have two applications that require different versions of PHP. That said, there are some tools for working with multiple PHP versions. PHPBrew is probably the easiest and most used. It’s particularly useful for a development environment where you need to switch between versions.
Regards, KDSys
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.