Mastering Development System & Network

install php5 but keep php7

I have upgraded, built a new one, my server (Ubuntu 18.04.6) which is running PHP Version 7.2.

I would like to install PHP5 and keep PHP7 and have the option to switch back and forth. Have a site that runs php5 that I only need up for a short time, plus do some code upgrade on other projects…

I have found instructions:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update


sudo apt-get install -y php5.6


sudo apt-get install php5.6 php5.6-mysql php5.6-gd php5.6-mcrypt php5.6-mbstring php5.6-sqlite3 libapache2-mod-php5.6

But it is usually followed up by intalling php7. I do not want to overwrite the php I already have…

Also, I do use webmin, and notice in the module page I can activate php7. I figured it would install a module (php5) that I can activate and deactivate.


Leave a Reply

Your email address will not be published. Required fields are marked *