日期:2011-02-23 18:06:00  来源:本站整理

<b>Ubuntu 10.04下的php5.3降级到php5.2</b>[服务器安全]

赞助商链接



  本文“<b>Ubuntu 10.04下的php5.3降级到php5.2</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

因为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 http://archive.Ubuntu.com/ubuntu/ karmic main restricted universe multiverse


deb-src http://archive.Ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://archive.Ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://archive.Ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://security.Ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://security.Ubuntu.com/ubuntu karmic-security main restricted universe multiverse



2 增添php相关包设置 【LINUX公社 www.LinuxIDC.com 】
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 http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
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   以上是“<b>Ubuntu 10.04下的php5.3降级到php5.2</b>[服务器安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:

  • <b>hosts是什么 hosts文件在什么位置 若何改正hosts</b>
  • <b>在 Windows 8 中手动安装语言包</b>
  • <b>五个常见 PHP数据库问题</b>
  • Windows中Alt键的12个高效快速的利用本领介绍
  • <b>MySQL ORDER BY 的实现解析</b>
  • <b>详解MySQL存储历程参数有三种范例(in、out、inout)</b>
  • <b>Win8系统恢复出来经典的开始菜单的办法</b>
  • <b>Win8系统花屏怎么办 Win8系统花屏的办理办法</b>
  • <b>Windows 7系统下无线网卡安装</b>
  • <b>为什么 Linux不需求碎片整理</b>
  • <b>Windows 8中删除账户的几种办法(图)</b>
  • <b>教你如安在win7下配置路由器</b>
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .