Ubuntu 10.04 Lucid 上安裝 php 5.2

pupur 2010-06-10

Ubuntu 10.04 上 php 版本是 5.3 不能用  zend Optimizer 只能改用 5.2 了

第一步:
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
第二步:
在 /etc/apt/preferences.d 中新建一個文件 php 內容如下:
Package: php5
Pin: release a=karmic
Pin-Priority: 991
Package: php5-gd
Pin: release a=karmic
Pin-Priority: 991
Package: php5-common
Pin: release a=karmic
Pin-Priority: 991
Package: php5-curl
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mysql
Pin: release a=karmic
Pin-Priority: 991
Package: php5-pear
Pin: release a=karmic
Pin-Priority: 991
Package: php5-xsl
Pin: release a=karmic
Pin-Priority: 991
Package: php-pear
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cli
Pin: release a=karmic
Pin-Priority: 991
Package: php5-memcache
Pin: release a=karmic
Pin-Priority: 991
Package: php5-pgsql
Pin: release a=karmic
Pin-Priority: 991
Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991
第三步:
sudo apt-get update
sudo apt-get remove php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache
sudo apt-get install php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache
補充: 如果沒有安裝  apache2 和 mysql 執行
sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-xsl php5-gd php-pear libapache2-mod-auth-mysql php5-mysql php5-curl php5-memcache
搞定 :)

相关推荐