Downgrade PHP from 5.3 to 5.2 on Ubuntu 10.04 Lucid Lynx

Ubuntu 10.04 holds PHP version 5.3 in its repositories. Although Joomla, vTiger and a number of applications are compatible with version 5.3 but some of the addons are still not compatible with version 5.2 so you can downgrade PHP using the following instructions:

Add the repository created by Ralph Janke by using the following command:

{code}add-apt-repository ppa:txwikinger/php5.2{/code}

Now you need to create a file to pin down the version so that it is not upgraded automatically by apt-get. The file called php should be created in /etc/apt/preferences.d/ directory with the following information in it.

{code}
Package: libapache2-mod-php5
Pin: version 5.2.10*
Pin-Priority: 991

Package: libapache2-mod-php5filter
Pin: version 5.2.10*
Pin-Priority: 991

Package: php-pear
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-cgi
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-cli
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-common
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-curl
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-dbg
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-dev
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-gd
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-gmp
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-ldap
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-mhash
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-mysql
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-odbc
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-pgsql
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-pspell
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-recode
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-snmp
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-sqlite
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-sybase
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-tidy
Pin: version 5.2.10*
Pin-Priority: 991

Package: php5-xmlrpc
Pin: version 5.2.10*
Pin-Priority: 991

 

Package: php5-xsl
Pin: version 5.2.10*
Pin-Priority: 991

{/code}

Now run apt-get update and apt-get install php5 as normal and PHP 5.2 packages built for Lucid will now be installed in your server. If you are having any difficulty in installing PHP version 5.2 or upgrading your web application to PHP version 5.3 you can hire Target Integration to do it for you.

Share on:

You may also like