Can I install two php versions in one droplet, help?

April 19, 2017 2k views
Apache Linux Basics PHP Ubuntu 16.04

I installed lamp and everything working fine, But the problem I have php 7.0 installed.
My script does not support php 7.0.
I need help in installing 5.6. with 7.0.
I do not want to downgrade my php 7.
Can i have two versions of php working at the same time.
Or I have to create another droplet for php 5.*.

Please make it clear if you want to help me.

1 comment
  • The first answer here might be what you're looking for, though I would question why you need PHP 7.0 installed anyway if your script is going to run at 5.6, it may be easier to just use 5.6.

1 Answer

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.

Have another answer? Share your knowledge.