Reverting or downgrade PHP 5.3 to 5.2 in Ubuntu Lucid Lynx 10.04
So, you upgraded to Ubuntu 10.04 but suddenly your old applications like Drupal do not work on PHP 5.3 anymore? What the hell?
Without asking why it doesn't work because we would only loose time we want to go back to the version of PHP 5.2 where it does work!
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 nano /etc/apt/preferences.d/php
And insert the following text
Pin: release a=karmic
Let's update the system. (You might want to do it twice to be sure)
sudo apt-get update
Installing php5 Karmic Packages. Attention! Only replace packages that were installed when doing the first command (remember the grep we did in the first step?)
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-mcrypt=5.2.10.dfsg.1-2ubuntu6 php5-mysql=5.2.10.dfsg.1-2ubuntu6 php5-pgsql=5.2.10.dfsg.1-2ubuntu6
There you go! A fully function 5.2.10 PHP installation without troubles. If somebody knows how to make persistent so an upgrade does not replace them anymore feel free to add a comment to this post.
More like this
- Nick_vh: @opidentica @vajrashura @brunodbo @kate15 @markstoddart Guide to Downgrade PHP 5.3 to 5.2 on Ubuntu Lucid 10.04 http://bit.ly/d5At2r
- Nick_vh: Lesson learned! No more PHP 5.3 for me until #Drupal 6 is fully compatible #fjew #ubuntu 10.04
- Nick_vh: @kafe15 It's ubuntu 10.04 so they have by default php 5.3 in the repo.. I guess I have to compile all?
- Nick_vh: Why is PHP 5.3 that different from 5.2 so even the most popular frameworks have problems to be compatible? #fail #drupal #joomla #wordpress
- Nick_vh: Anyone knows how to downgrade PHP5.3 to 5.2? #php #ubuntu #help?:)