博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

CentOS5使用Yum安装PHP5.3

Posted on 2013-04-08 14:50  Bruce Zhang  阅读(734)  评论(0编辑  收藏  举报

本文介绍在CentOS5.*版本中把php5.1升级到当前主流版本php5.3. php5.1版本与php5.2及以上版本有许多不同,如新版本加入的json扩展等等.

让我们开始吧,以64位系统为例

使用remi及epel源升级php

【step1: 安装remi及epel源】

#下载并安装epel源  
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

#下载并安装remi源  
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

关于epel,请参考官方文档:http://fedoraproject.org/wiki/EPEL/zh-cn

如果既想获得 RHEL 的高质量、高性能、高可靠性,又需要方便易用(关键是免费)的软件包更新功能,那么 Fedora Project 推出的 EPEL(Extra Packages for Enterprise Linux)正好适合你。EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目

关于remi,请参考官方文档:http://rpms.famillecollet.com/

remi软件源对旧的fedora版本提供最新的软件支持,也可以为Centos及RHEL提供最新的软件

【step2:安装php】

#如果已经安装php,请使用  
yum --enablerepo=remi update php php-*  

#如果未安装过php,请使用  
yum --enablerepo=remi install php php-*  

 

异常解决:

(1)Error: php53-common conflicts with php-common

解决方式:(参考:http://serverfault.com/questions/276459/centos-5-6-how-to-resolve-php53-rpm-dependency-conflict-with-php-mcrypt-and-php

yum reinstall php*