---
title: "centos5.5 yum安装 php5.3"
author: "wanglu132"
date: "2012-09-05T14:44:28Z"
tags: []
categories: ["开源软件"]
slug: "centos5-5-yum-php5-3"
draft: false
lastmod: "2012-09-05T15:14:58Z"
id: 1671955
url: "https://wanglu132.iteye.com/blog/1671955"
---

**1,先卸载php**

 

    查询本机已安装的php:

```
rpm -qa | grep php
```

    卸载：

```
rpm -e php-5.1.6-39.el5_8 php-common-5.1.6-39.el5_8 php-cli-5.1.6-39.el5_8
```

 

**2,安装第三方源**

 

```
rpm -Uhv http://mirrors.ircam.fr/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
rpm -Uhv http://mirrors.ircam.fr/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm
```

 

**3,安装php**

 

```
yum --enablerepo=ius install php54 php54-mysql
```

 

**4,测试**

 

```
httpd -t -D DUMP_MODULES
```

 Loaded Modules:  
 core\_module (static)

 ......

 php5\_module (shared)  
 ......  
Syntax OK

 

```
php -v
```

 PHP 5.3.16 (cli) (built: Sep  5 2012 18:29:29)  
Copyright (c) 1997-2012 The PHP Group  
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies