CentOS 5.3通过yum升级php到最新版本的方法


方法一
CentOS5.3的php版本默认为5.1.6,然后在5.2.9版本之前的的php都存在一个漏洞,但是目前网上很多地方都无法使用yum update php*升级到5.2.9,比较常见的是升级到5.2.6版本的,经过搜索国外资料,现在终于找到一种升级CentOS的php到5.2.9的方法。
注意,此方法只能在官方的php版本上升级,如果你使用网上的升级到5.2.6版本的升级方法已经升级了,将无法使用本方法升级php。
运行下面命令:
 
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-7.el5.remi.noarch.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
然后编辑/etc/yum.repos.d/remi.repo
#vi /etc/yum.repos.d/remi.repo
在这个文件的最后增加一行:
priority=1
保存退出。
/etc/yum.repos.d/epel.repo和/etc/yum.repos.d/epel-testing.repo这两个文件也按照上面的方法进行编辑!
使用下面的命令进行升级,但是经过测试,如果单独升级php将提示失败,只有联通mysql一起升级才可以,所以我们必须执行以下命令才能升级php到 5.2.9版本:
yum –-enablerepo=remi update php* mysql*
PS: 这种方式 将 php 升级 到 5.3了
方法二
或者 去 http://oss.oracle.com/
来源:(http://blog.sina.com.cn/s/blog_45ef57d40100hq7c.html) – CentOS 5.3 通过yum升级php到最新版本的方法_博睿_新浪博客
下再 php5.2的rpm包

方法三
vim /etc/yum.repos.d/utterramblings.repo
输入
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
最后安装
yum install httpd php
目前我用的 就是通过 这种方式装的
php-5.2.11
httpd-2.2.14
方法4
CentOS为yum添加官方源
由于centos5.4安装好后通过yum来安装php的版本是5.1.6,现在很多站点都是在5.2.x上开发的,所以我们要添加其他的yum repo
来安装Php5.2.x的版本,测试了几个非官方的repo仓库,感觉代码都不是很稳定,php版本也随时在升级。找了很久,发现centos
官方的一个test repo里面有php5.2.x,安装centos官方的rpm比较放心
1.添加yum repo php5.2.x
vi /etc/yum.repos.d/CentOS-Testing.repo
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
priority=1
2.安装
yum upgrade php
 

相关内容

    暂无相关文章