Anda dapat menginstal kedua versi php paralel misalnya PHP 5.5x dan 5.3x atau bahkan tiga versi PHP paralel misalnya PHP 5.5x, 5.4x dan 5.3x menggunakan fastcgi.
1. Instal Libs, fastCGI, git
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install libxml2 libxml2-dev libssl-dev
sudo apt-get install libcurl4-openssl-dev pkg-config
sudo apt-get install libcurl4-gnutls-dev libjpeg-dev libpng12-dev libmysqlclient-dev
sudo apt-get install git
cd /opt
sudo git clone https://github.com/cweiske/phpfarm
sudo apt-get install libapache2-mod-fastcgi apache2-mpm-worker apache2-suexec
sudo a2enmod actions fastcgi suexec
sudo service apache2 restart
2. Kompilasi PHP dan verifikasi
cd /opt/phpfarm/src
sudo ./compile.sh 5.3.29
cd /opt/phpfarm/inst/bin
./php-5.3.29 --version
3. Konfigurasikan FastCGI
sudo mkdir /var/www/cgi-bin
cd /var/www/cgi-bin
sudo nano php-cgi-5.3.29
#!/bin/sh
PHPRC="/etc/php5/cgi/5.3.29/"
export PHPRC
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /opt/phpfarm/inst/bin/php-cgi-5.3.29
Jadikan file ini dapat dieksekusi.
4. Buat host virtual baru
Masukkan ini ke host Anda:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName fastcgidemo.dev
DocumentRoot /var/www/fastcgidemo
#php-cgi setup
#used for multiple php versions
FastCgiServer /var/www/cgi-bin/php-cgi-5.3.29
ScriptAlias /cgi-bin-php/ /var/www/cgi-bin/
<Directory "/var/www/fastcgidemo">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
AddHandler php-cgi .php
Action php-cgi /cgi-bin-php/php-cgi-5.3.29
<FilesMatch "\.php$">
SetHandler php-cgi
</FilesMatch>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_fastcgidemo.log
CustomLog ${APACHE_LOG_DIR}/access_fastcgidemo.log combined
</VirtualHost>
Tambahkan domain ke / etc / hosts
127.0.0.1 fastcgidemo.dev
5. Uji semuanya
Aktifkan situs dan mulai ulang apache dan buat file baru dengan phpinfo () di / var / www / fastcgidemo untuk menguji konfigurasi Anda.
Buka browser dan ketik fastcgidemo.dev
Semoga ini bisa membantu!
Tutorial Lengkap tentang:
http://www.jabommi.de/wiki/downgrade-php-5-5-to-5-3-ubuntu-14-with-multiple-php-versions/