If you want to Install Multiple PHP version on ubuntu/Linux system then this tutorial is for you.

and on ubuntu shell using root user and follows steps below:

1) check and Update the repository cache of ubuntu.

sudo apt update

2) Install required Packages

sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https

3) Add repository for mutiple php

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

4) Now Install PHP vesions:

php7.1

sudo apt install -y php7.1 php7.1-cli php7.1-common

php7.2

sudo apt install -y php7.2 php7.2-cli php7.2-common

php7.3

sudo apt install -y php7.3 php7.3-cli php7.3-common

All installed php version you have to will see on /etc/php/7.x

5) change and check php version:

To enable any php version:

a2enmod php7.2

restart apache to apply changes

service apache restart

Verify php version

php -version

All Done


Please Comment your thoughts and feedback below and add something if you found good in anywhere to help others

Hit a like Button If you like the Post.

Many Thanks