背景:
阅读新闻
Ubuntu 10.04下的php5.3降级到php5.2
[日期:2010-12-04] 来源:Ubuntu论坛 作者:xdh2010 [字体:]
因为Ubuntu 10.04下Zend Optimizer 3.3.9都还没有开始支持php5.3,所以把ubuntu10.4的php5.3降级到php5.2
步骤:
1 增加karmic源
x@y:~$sudo vi /etc/apt/sources.list.d/karmic.list
deb karmic main restricted universe multiverse
deb-src karmic main restricted universe multiverse
deb karmic-updates main restricted universe multiverse
deb-src karmic-updates main restricted universe multiverse
deb karmic-security main restricted universe multiverse
deb-src karmic-security main restricted universe multiverse
2 增加php相关包设置 【LINUX公社 】
x@y:~$sudo vi /etc/apt/preferences.d/php
Package: libapache2-mod-php5
Pin: version 5.2.10*
Pin-Priority: 991
Package: libapache2-mod-php5filter
Pin: version 5.2.10*
Pin-Priority: 991
Package: php-pear
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-cgi
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-cli
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-common
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-curl
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-dbg
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-dev
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-gd
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-gmp
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-ldap
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-mhash
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-mysql
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-odbc
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-pgsql
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-pspell
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-recode
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-snmp
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-sqlite
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-sybase
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-tidy
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-xmlrpc
Pin: version 5.2.10*
Pin-Priority: 991
Package: php5-xsl
Pin: version 5.2.10*
Pin-Priority: 991
3 建立降级脚本
x@y:~$vi down5.3-5.2.sh
#! /bin/sh -e
# script to install PHP 5.2 from 9.10 on 10.04
# And pin it so it does not get updated
# package available and may be installed later
PKGSAVAILABLE="`aptitude search -F '%p' php5` php-pear"
PKGSINSTALLED=`dpkg -l | grep php | awk '{print $2}'`
aptitude remove $PKGSINSTALLED
# disable duplicate entries
grep 'ubuntu.com' /etc/apt/sources.list | sed s/lucid/karmic/g > tee /etc/apt/sources.list.d/karmic.list
for PACKAGE in $PKGSAVAILABLE
do
# aptitude seems to use /etc/apt/preferences but not /etc/apt/preferences.d/*
# cf https://bugs.launchpad.net/ubuntu/+source/aptitude/+bug/508545
if egrep -q "Package: ?$$" /etc/apt/preferences
then
echo "$PACKAGE already in preference"
else
echo "\nPackage: $\nPin: release a=karmic\nPin-Priority: 991" >> /etc/apt/preferences
fi
done
aptitude update
aptitude install $PKGSINSTALLED
njava@njava.com:~$chmod 755 down5.3-5.2.sh
4 配置zend
root@y:~# wget
root@y:~# cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php5/20060613+lfs/
root@y:~# vi /etc/php5/cgi/conf.d/zendoptimizer.ini
extension=ZendOptimizer.so
root@y:~# /etc/init.d/apache2 restart
相关资讯 Ubuntu 10.04
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯