Friday, August 26, 2011

Downgrade PHP


This post is all about downgrading your PHP 5.3.x to PHP 5.2 because some of your old packages will not work with the PHP 5.3.x.

Essentially, all you have to do is tell the apt system where to find Karmic packages and then tell it that you want it to use Karmic's PHP packages.

So put the "karmic.list" in /etc/apt/sources.list.d and the "php" into /etc/apt/preferences.d.

Then:
sudo apt-get update

sudo apt-get remove php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

sudo apt-get install php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

If you had not already installed apache, php, and mysql, you can do that with the above files in place and get the right versions without removing anything:

sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-xsl php5-gd php-pear libapache2-mod-auth-mysql php5-mysql php5-curl php5-memcache

Note: Your php.ini will have been replace, so you have to reset custom settings like memory_limit.

0 comments:

Post a Comment