wlanboy

tutorials and ruby scripts

Read my tutorials

Read my gists

Gist

Gist: two-php-versions-and-apache2

apt update
apt install apache2 libapache2-mod-fcgid apache2-utils software-properties-common

apt install php5.6 php5.6-fpm php5.6-zip php5.6-sqlite3 php5.6-mysql php5.6-mcrypt php5.6-mbstring php5.6-gd php5.6-imagick
apt install php7.2 php7.2-fpm php7.2-zip php7.2-sqlite3 php7.2-mysql php7.2-mbstring php7.2-gd php7.2-imagick

a2enmod actions alias proxy_fcgi fcgid
systemctl restart apache2

nano /etc/apache2/apache2.conf
-------------------------------------------------------------

        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted


        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted


        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

-------------------------------------------------------------

mkdir /var/www/html/php56 
echo "" > /var/www/html/php56/index.php
echo -e "\nSetHandler \"proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/\"\n" > /var/www/html/php56/.htaccess

mkdir /var/www/html/php72
echo "" > /var/www/html/php72/index.php
echo -e "\nSetHandler \"proxy:unix:/var/run/php/php7.2-fpm.sock|fcgi://localhost/\"\n" > /var/www/html/php72/.htaccess

http://127.0.0.1/php56/index.php
http://127.0.0.1/php72/index.php