centos5 升级 php 到 5.3.3 简单方法

安装EPEL包

$rpm -ivh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-4.noarch.rpm

#32位的安装32位的包:
$rpm -ivh http://download.fedora.redhat.com/pub/epel/5Server/i386/epel-release-5-4.noarch.rpm

#centos5 先升级到 centos5.7 版本
$yum update -y
$cat /etc/redhat-release
CentOS release 5.7 (Final)

#查看已经安装的php包
$yum list installed |grep php |cut -d'.' -f1
php
php-cli
php-common
php-gd
php-ldap
php-mysql
php-pdo
php-mcrypt

#停止httpd服务
$service httpd stop

#卸载旧版本php
$yum remove php php-cli php-common php-gd php-mysql php-pdo php-ldap php-mcrypt

#升级php
$yum install php53 php53-cli php53-common php53-gd php53-ldap php53-mysql php53-pdo php53-mcrypt
$php -v
PHP 5.3.3 (cli) (built: Nov 2 2011 23:35:50)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
$service httpd start