Skip to content

Instantly share code, notes, and snippets.

@sirleech
Created February 10, 2012 04:14
Show Gist options
  • Save sirleech/1786544 to your computer and use it in GitHub Desktop.
Save sirleech/1786544 to your computer and use it in GitHub Desktop.
Revert PHP 5.3 to 5.2 (better compatibility with Drupal 6)

Let us list all existing PHP packages to know what version we are running:

# dpkg -l | grep php

So, now we are going to duplicate the existing sources.list and replace the lucid with karmic repos and saving it in sources.list.d

# sed s/lucid/karmic/g /etc/apt/sources.list | \ 
  sudo tee /etc/apt/sources.list.d/karmic.list

Create a file to be a little bit ahead of our apt-get system.

# sudo vim /etc/apt/preferences.d/php

And insert the following text

Package: php5
Pin: release a=karmic
Pin-Priority: 991

Let's update the system. (You might want to do it twice to be sure)

#sudo apt-get update

Install:

# sudo apt-get install php5=5.2.10.dfsg.1-2ubuntu6 php5-dev=5.2.10.dfsg.1-2ubuntu6 
php-pear=5.2.10.dfsg.1-2ubuntu6 php5-cgi=5.2.10.dfsg.1-2ubuntu6 
php5-cli=5.2.10.dfsg.1-2ubuntu6 php5-common=5.2.10.dfsg.1-2ubuntu6 
php5-curl=5.2.10.dfsg.1-2ubuntu6 php5-gd=5.2.10.dfsg.1-2ubuntu6 php5-mysql=5.2.10.dfsg.1-2ubuntu6 
php5-pgsql=5.2.10.dfsg.1-2ubuntu6 libapache2-mod-php5=5.2.10.dfsg.1-2ubuntu6

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment