一、版本环境
# rpm -q php
二、用Yum 升级PHP
# yum update php
Could not find update match for php
No Packages marked for Update
看来Centos系统软件仓库中的php没有更新,又不想重新手动编译安装php,既然官方的yum源里面没有,那就添加一个源吧!
# rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
# 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 update php (在更新PHP时候mysql一起更新并报错;处理在第三大点)
Transaction Check Error:
file /etc/my.cnf from install of mysql-5.1.58-jason.1.x86_64 conflicts with file from package mysql-5.0.77-4.el5_5.4.i386
# yum update mysql
三、更新PHP时mysql报错的处理
1、首先把原本的PHP版本删除
# yum remove php*
2、查看一下是否删除
# rpm -q php
删除成功:package php is not installed
3、安装PHP53
# yum -y install php53*
注意:
php53-odbc64-5.3.3-2.el5.x86_64 from base has depsolving problems
--> php53-odbc64 conflicts with php53-odbc
Error: php53-odbc64 conflicts with php53-odbc
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
# yum -y install php53* --skip-broken
安装成功会最后出现Complete!
4、查看PHP版本
# rpm -q php53
php53-5.3.3-13.el5_8
5、启动PHP与MYSQL
# service httpd start
# service mysqld start
本文转自 kuangling 51CTO博客,原文链接:http://blog.51cto.com/kling/1130085