Você pode fazer o Ubuntu 14.04 (Trusty Tahr) usar os pacotes do Ubuntu 9.10 (Karmic Koala) para instalar facilmente o PHP 5.2. Foi assim que instalei o PHP 5.2.10 no Ubuntu 14.04.3.
Etapa 1
Crie um arquivo karmic.list
em /etc/apt/sources.list.d/
e adicione o seguinte:
deb http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ karmic universe
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic universe
deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
deb http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
deb http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
deb http://old-releases.ubuntu.com/ubuntu karmic-security universe
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security universe
deb http://old-releases.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security multiverse
Etapa 2
Em seguida, crie outro arquivo php5_2
in /etc/apt/preferences.d/
com o seguinte:
Package: apache2*
Pin: release a=karmic
Pin-Priority: 991
Package: php5
Pin: release a=karmic
Pin-Priority: 991
Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991
Package: libapache2-mod-php5filter
Pin: release a=karmic
Pin-Priority: 991
Package: php-pear
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cgi
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cli
Pin: release a=karmic
Pin-Priority: 991
Package: php5-common
Pin: release a=karmic
Pin-Priority: 991
Package: php5-curl
Pin: release a=karmic
Pin-Priority: 991
Package: php5-dbg
Pin: release a=karmic
Pin-Priority: 991
Package: php5-dev
Pin: release a=karmic
Pin-Priority: 991
Package: php5-gd
Pin: release a=karmic
Pin-Priority: 991
Package: php5-gmp
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mhash
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mysql
Pin: release a=karmic
Pin-Priority: 991
Package: php5-odbc
Pin: release a=karmic
Pin-Priority: 991
Package: php5-pgsql
Pin: release a=karmic
Pin-Priority: 991
Package: php5-pspell
Pin: release a=karmic
Pin-Priority: 991
Package: php5-recode
Pin: release a=karmic
Pin-Priority: 991
Package: php5-snmp
Pin: release a=karmic
Pin-Priority: 991
Package: php5-sqlite
Pin: release a=karmic
Pin-Priority: 991
Package: php5-sybase
Pin: release a=karmic
Pin-Priority: 991
Package: php5-tidy
Pin: release a=karmic
Pin-Priority: 991
Package: php5-xmlrpc
Pin: release a=karmic
Pin-Priority: 991
Package: php5-xsl
Pin: release a=karmic
Pin-Priority: 991
Etapa 3
Em seguida, execute sudo apt-get update
e, finalmente, instale-os usando o seguinte (exemplo):
sudo apt-get install apache2 libapache2-mod-php5 php-pear php5-curl php5-dbg php5-mhash php5-mysql php5-tidy php5-xmlrpc php5-xsl
p / s: Você pode adicionar outras extensões php no comando de instalação acima, mas apenas aquelas definidas no arquivo de preferência php5_2
, caso contrário ele irá instalar a versão errada.