ubuntu10.04 的php版本是 php5.3, 很多程序可能不支持, 降级到php5.2 的方法如下:
01 |
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr"\n" " "` |
02 |
echo -e "Package: php5\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee /etc/apt/preferences.d/php > /dev/null |
03 |
apt-cache search php5-|grep php5-|awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'|sudo tee -a /etc/apt/preferences.d/php > /dev/null |
04 |
apt-cache search -n libapache2-mod-php5 |awk '{print "Package:", $1,"\nPin: release a=karmic\nPin-Priority: 991\n"}'| sudo tee -a /etc/apt/preferences.d/php > /dev/null |
05 |
echo -e "Package: php-pear\nPin: release a=karmic\nPin-Priority: 991\n" | sudo tee -a /etc/apt/preferences.d/php > /dev/null |
| 06 |
grep 'main restricted' /etc/apt/sources.list|grep -v "#"| seds/lucid/karmic/g | sudo tee/etc/apt/sources.list.d/karmic.list > /dev/null |
08 |
sudo aptitude install -t karmic php5-cli php5-cgi |
09 |
sudo aptitude hold `dpkg -l | grep php5| awk '{print $2}' |tr"\n" " "` |
来源:http://mrkandy.wordpress.com/2010/04/16/install-php-5-2-x-in-ubuntu-10-04-lucid/
最新评论