Downgrade PHP to PHP5.2?
Solution 1
The first way is using Andphe's PPA. This method is described here.
- Uninstall all PHP packages.
- Add the repo by executing
sudo apt-add-repository ppa:andphe/php && sudo apt-get update
- Open Synaptic. Go to Settings -> Repositories. Select the repository we have just added and click "Edit..." Replace "natty" with "maverick". Click "Ok" then "Close".
- Click the reload button.
- Now find the php5 package. Press Ctrl + E. Select the version from the PPA. In the main menu, click Package -> Lock Version.
- Repeat step 5 for other PHP packages.
- Apply the changes.
N.B. start with "libapache2-mod-php5", "php5-common", "php5-cli" and then the rest
The second way is attempting to install packages built for Lucid. They can be found here. Just download the packages, dpkg -i them all, and then pin all of them. I will not go into detail because I think that the first way is better.
The third way is installing from source. This guide seems quite good. This is your fallback route.
Solution 2
It might be better to try and work out why the PHP script doesn't work with PHP 5.3. It could just be down to some deprecated code that can easily be replaced
The PHP manual has a section on migrating from 5.2 to 5.3: http://php.net/manual/en/migration53.php
Related videos on Youtube
![traveh](https://i.stack.imgur.com/iojsu.jpg?s=256&g=1)
traveh
My name is Amir Ashkenazi and I am an accomplished web-site developer and webmaster. i own a blog about web developing web developers, computer geeks and site owners
Updated on September 18, 2022Comments
-
traveh almost 2 years
I want to install PHP 5.2 in Ubuntu 11.04 , I had some script that did that thing good but only on Ubuntu 9, anyone has a script / instructions how to do it?
-
nilsonneto almost 13 yearsI may be reading the script wrongly... but wouldnt that leave your sources list as karmic - wouldnt you need to reset it back to natty after the install?
-
Jose Silva almost 13 years@fossfreedom Wait, yes...
-
nilsonneto almost 13 yearsthis could become a very good answer if you can highlight in the answer the relevant parts of the links that answer the question. Usually you just link back to the "source" to indicate where you got the answer.
-
traveh almost 13 yearsyeah, but the issue that is the most servers (shared hosting) are still have 5.2
-
traveh almost 13 yearsi run this script: pastebin.com/C41eXyKi , how can i revert those actions and do the install as you told me?
-
Jose Silva almost 13 years@Amir Ashkenazi Just remove all the PHP packages, then go to /etc/apt/sources.list.d/ and remove karmic.list.