Many php applications have compatibility issues with php 5.3.1. Unfortunately in that is the only version currently available in the aptitude repositories for the latest version of Ubuntu.
Once you have either freshly installed Ubuntu and php, or after you update just your distro and do an apt-get update, you will be on 5.3. There are lots of people with this problem. Many of them have solutions. Most involve running lots of terse commands. Then I ran across this shell script that once you have everything installed for php 5.3 will downgrade your stack to 5.2.10 for you. Since I’ve had trouble finding the original source after a few days, here’s the source in case you need it.
#! /bin/sh php_packages=Copy this script into a file in your home directory, make it executable and then run it. It set everything up for me really well.dpkg -l | grep php | awk '{print $2}'sudo apt-get remove $php_packages
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
sudo mkdir -p /etc/apt/preferences.d/
for package in $php_packages; do echo "Package: $package Pin: release a=karmic Pin-Priority: 991 " | sudo tee -a /etc/apt/preferences.d/php done
sudo apt-get update
sudo apt-get install $php_packages
October 21st, 2010 at 8:34 am
Hello Does this work for Ubuntu 10.10?
October 21st, 2010 at 8:40 am
it should continue to work, except instead of searching for lucid, search for maverick. So all instances of lucid in the script need replaced with maverick and then it will replace the php sources with karmic. Stay tuned for an update, I’m upgrading to 10.10 on my main dev machine this weekend.
January 22nd, 2011 at 3:22 am
The script worked like a charm.Thank you very much for the script.
March 27th, 2011 at 12:29 pm
Karmic allows to install 5.2.10. Any way to install PHP 5.2.5 or 5.2.6 My App do not work in version beyond 5.2.6
Thanks is advance.