CentOS添加YUM源 PHP升级到5.2.*

作者:system 发布于:2012-2-15 23:41 分类:未分类

WordPress3.3需要PHP-5.2.4以上版本,CentOS-5.5,系统自带PHP的版本:5.1.6

# yum update php
发现系统自带的YUM源没更新,想到升级到5.2.4,那就得添加更新源了。如下:

1.编辑/etc/yum.repos.d/CentOS-Base.repo文件,将下面的内容添加到文件的末尾:
[CentOS-Testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to
# CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to
# function properly.
# These packages build and install, but are waiting for feedback from testers as
# to functionality and stability. Packages in this repository will come and go
# during the development period, so it should not be left enabled or used on
# production systems without due consideration.

在CentOS-Base.repo文件中不要启用CentOS-Testing,必要的时候用yum的enablerepo参数就可以了,所以上面enabled参数后面的值是0;

2.检查CentOS-Testing中是否有关于PHP的可用更新;
yum –disablerepo=* –enablerepo=CentOS-Testing check-update php*

3.更新PHP相关的软件
yum –disablerepo=* –enablerepo=CentOS-Testing update php*

Powered by emlog