---
title: "centos 5.5 yum 升级  php"
author: "csstome"
date: "2011-06-09T15:36:00Z"
tags: []
slug: "centos-5-5-yum-php"
draft: false
lastmod: "2011-10-28T08:47:54Z"
id: 1219520
url: "https://csstome.iteye.com/blog/1219520"
---

来自：http://blog.sina.com.cn/s/blog\_620ad6170100onk3.html

今天安装tokyo tyrant 的php客户端，因为我的机器是centos5.5 默认PHP版本是5.1.6的。ttphp客户端需要5.2以上的版本，用yum update 的时候老是出错，常规的yum更新不了5.2以上版本。  
google了老半天，终于找到一个可以更新PHP版本的YUM 源。  
1.编辑vim /etc/yum.repos.d/CentOS-Base.repo 然后shift+g 跳到最后一行添加并保存  
`[c5-testing] name=CentOS-5 Testing baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/ enabled=0 gpgcheck=1 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing 2.停用其他源，就是要CentOS-Testing 来搜索PHP的更新` `yum --disablerepo=* --enablerepo=c5-testing check-update php* 3.如果没有问题就安装吧。` `yum --disablerepo=* --enablerepo=c5-testing update php* 确认一下版本，是否已审计/usr/bin/php -v 操作很简单，就是找到合适的答案比较浪费时间。也算是学习了！`