Você pode instalar as duas versões paralelas do php, por exemplo, PHP 5.5x e 5.3x, ou mesmo três versões PHP paralelas, por exemplo, PHP 5.5x, 5.4x e 5.3x usando o fastcgi.
1. Instale 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. Compile o PHP e verifique-o
cd /opt/phpfarm/src
sudo ./compile.sh 5.3.29
cd /opt/phpfarm/inst/bin
./php-5.3.29 --version
3. Configure o 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
Torne este arquivo executável.
4. Crie um novo host virtual
Coloque isso no seu host:
<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>
Adicione os domínios ao / etc / hosts
127.0.0.1 fastcgidemo.dev
5. Teste tudo
Habilite o site e reinicie o apache e crie um novo arquivo com phpinfo () em / var / www / fastcgidemo para testar sua configuração.
Vá para o navegador e digite fastcgidemo.dev
Espero que ajude!
Tutorial completo sobre:
http://www.jabommi.de/wiki/downgrade-php-5-5-to-5-3-ubuntu-14-with-multiple-php-versions/