Remove / purge php and install php 7.0 and 5.* in same machine linux ubuntu 16.04

First of all remove php
———————————–
This should completely remove any package which name starts with php and anything related to it.
sudo apt-get -y purge php.*


Now next step ref: http://tecadmin.net/install-php5-on-ubuntu/#

Install PHP 5.6

Use the following set of command that adds PPA for PHP 5.6 in your system to install PHP 5.6.

 

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php5.6

 

Install PHP 5.5

Use the following set of command to add PPA for PHP 5.5 in your Ubuntu system and install PHP 5.5.

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install -y php5.5

Copyright © 2020. Powered by WordPress & Romangie Theme.