Running Multiple PHP Versions on Single Server

Pubblicato il: 30 settembre 2024
sul canale di: Moodler Arjun
1,271
18

This video describes the installation and configuration of 2 VirtualHost on Apache with separate PHP versions. 1st VirtualHost will work with PHP 7.1. 2nd VirtualHost will run with PHP 8.0.

Execute the following commands to install the latest available version of the Apache webserver.
For PHP 7.1
sudo apt update
sudo apt-get install php7.1-fpm libapache2-mod-php7.1 libapache2-mod-fcgid -y
sudo systemctl start php7.1-fpm
sudo systemctl status php7.1-fpm

sudo mkdir /var/www/71.demo.com
sudo chown -R www-data:www-data /var/www/71.demo.com
sudo chmod -R 755 /var/www/71.demo.com
sudo vi /var/www/71.demo.com/info.php

sudo vi /etc/apache2/sites-available/71.demo.com.conf
sudo a2ensite 71.demo.com

http://71.demo.com
Run on Browser after common setting as mentioned below.

For PHP 8.0
sudo apt update
sudo apt-get install php8.0-fpm libapache2-mod-php8.0 libapache2-mod-fcgid -y
sudo systemctl start php8.0-fpm
sudo systemctl status php8.0-fpm

sudo mkdir /var/www/80.demo.com
sudo chown -R www-data:www-data /var/www/80.demo.com
sudo chmod -R 755 /var/www/80.demo.com
sudo vi /var/www/80.demo.com/info.php

sudo vi /etc/apache2/sites-available/80.demo.com.conf
sudo a2ensite 80.demo.com

http://80.demo.com
Run on Browser after common setting as mentioned below.

Common Execution
sudo a2enmod actions fcgid alias proxy_fcgi
sudo vi /etc/hosts

127.0.0.1 71.demo.com
127.0.0.1 80.demo.com
sudo systemctl restart apache2
sudo apachectl configtest

Thats It Guys. Have a Good Day!!

I hope you gain something out of this video. Incase you got any queries, do comment the same in the comment box. Also please make sure to like this video and subscribe to my channel.
{ Moodle Arjun }: { / @moodlerarjun }


In questa pagina del sito puoi guardare il video online Running Multiple PHP Versions on Single Server della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Moodler Arjun 30 settembre 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,271 volte e gli è piaciuto 18 spettatori. Buona visione!