下载rpm。
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-7.el5.remi.noarch.rpm安装rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm修改repo优先级。 编辑
/etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/epel.repo
在这个3个文件的最后都增加一行:
priority=1升级php到最新版本。 现在是5.3.2。 使用下面的命令进行升级(经过测试,如果单独升级php将提示失败,只有连同mysql一起升级才可以,所以我们必须执行以下命令才能升级 php到5.2.9版本):
yum –enablerepo=remi update php* mysql*安装memcached
yum –enablerepo=remi install memcached php-pecl-memcached
=========
经 本人测试,yum php mysql等后,再运行 yum –enablerepo=remi update php* 会出 “file /etc/my.cnf from install of mysql-libs-5.5.15-1.el5.remi.x86_64 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386”等系列错误,估计是已经安装有旧版本,不让再安装。所以只有 yum -y remove php mysql 等 后再运行: yum –enablerepo=remi install update php* 才OK,不能直接升级。
查看PHP版本命令:php --version 显示为5.3.3版本,OK!
=========