These modules are necessary to integrate PHP FPM and FastCGI with Apache server. Now enable few modules required for the configuration of multiple PHP versions with Apache.
Recommended: How to Enable/Disable PHP Modules on Ubuntu.Use the following commands to make sure both services are running. apt updateĪfter installation, php-fpm services will be started automatically.
Let’s install the following packages on your system. To use the multiple PHP versions, we will use PHP FPM and FastCGI. # On Ubuntu 16.04 sudo apt install python-software-propertiesįor this tutorial, we are using the PHP 5.6 and PHP 7.2 to configure with Apache web server. # On Ubuntu 18.04 sudo apt install software-properties-common Use the below couple of commands to add the PPA to your system. Ubuntu 18.04 Users: sudo apt install apache2 libapache2-mod-fcgidįor the installation of PHP versions, we use the PPA maintained here. Sudo apt install apache2 libapache2-mod-fastcgi Execute the following commands to install the latest available version of Apache web server. Launch terminal on your system or login with ssh for remote systems. Install Apache web server from the official repository. You can also use more than two PHP versions with Apache as required but this tutorial covers two only. First VirtualHost will work with PHP 5.6 and another VirtualHost will run with PHP 7.2.
This tutorial describes the installation and configuration of two VirtualHost on Apache with separate PHP versions. This tutorial will help you to install multiple PHP version with Apache on Ubuntu 18.04 and 16.04 system without switching PHP versions. But some of the system administrators are not aware of this. Also, most of you are aware of the configuration, I used in this tutorial. Some of the host managers are using Docker to run multiple PHP version on the single server. Generally, the hos manager used a separate server for each PHP version application deployment.