Multiple PHP Versions on Ubuntu 18.04

Posted by

First, you will need to add PHP repository to your server to install multiple versions of PHP. You can add Ondrej PHP repository with the following command:

apt-get install software-properties-common -y
add-apt-repository ppa:ondrej/php

Next, update the repository with the following command:

apt-get update -y

Once the repository is up to date, install PHP 7.0, PHP 7.2 and PHP-FPM with the following command:

apt-get install php7.0 php7.0-fpm php7.2 php7.2-fpm -y
 apt-get install php7.4 php7.4-fpm php7.4 php7.4-fpm -y 

Leave a Reply