I need to downgrade my PHP to 5.2.x from 5.3.x Certain software I currently use requires it. I found all these link explaining how to do it but they no longer work because they show you how to use the Karmic archives to downgrade but as those archives no longer exist on archive.ubuntu.com
I found this script on the ubuntu forums which worked for me
On ubuntu 10.10 you'll need to install
Even when there is no Karmic repos available, you could use older ones from 8.04. For Hardy is 5.2.4 available. So first solution is to use those links and make Karmic -> Hardy.
But mixing repos from two different realeases may become painful. So i don't suggest to add other realease to your apt sources. I prefer to install downloaded
5.2 is unsupported and RIFE with security holes.
However if you must use it, you can probably port the hardy-security package forward, as it is 5.2.4. It will be supported until April of 2013.
Still, you're going to be in better shape running the distro version of PHP and fixing your PHP apps than trying to deal with old broken PHP.
Uset this script on Ubuntu forum. It worked for me flawlessly. But the 'first' link above has some invalid urls and the 'second' script above is customized for apache.
You should install PHP 5.2 from source.
First of all you have to download the sources, install the required dependencies, after that configure based on your needs and install.
The steps can be found here.
Why not just try to install PHP through apt-get.
After you have apache up and running:
Call that file in a browser:
If you want a specific version of php package you can create a file called /etc/apt/preferences.d/php
Put the packages you want to install and corresponding versions, for example:
And try again the command for installing php:
For all php-related packages use the historical repositories from old-releases.ubuntu.com for the karmic Ubuntu release to downgrade to php 5.2
I created a script solution here: http://ubuntuforums.org/showpost.php?p=9201854&postcount=6
it adds the histroical sources to a file /etc/apt/preferences.d/php5_2 that locks all php-related packages to karmic.
your system will stil stay on the actual release (11.10) onnly php will be taken from the old release
You can install both php versions parallel e.g. PHP 5.5x and 5.3x or even three PHP versions parallel e.g. PHP 5.5x , 5.4x and 5.3x using fastcgi.
1. Install Libs, fastCGI, git
2. Compile PHP and verify it
3. Configure FastCGI
Make this file executable.
4. Create a new virtual host
Put this into your host:
Add the domains to /etc/hosts
5. Test everything
Enable site and restart apache and create a new file with phpinfo() in /var/www/fastcgidemo to test your configuration.
Go to browser and type in fastcgidemo.dev
Hope it helps!
Full Tutorial on:
I would suggest you install the following: