前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOs5.2中PHP的升级

CentOs5.2中PHP的升级

作者头像
大江小浪
发布2018-07-25 10:46:40
5250
发布2018-07-25 10:46:40
举报
文章被收录于专栏:小狼的世界小狼的世界

最近一个项目中需要使用到PHP5.2的版本,而服务器上使用了官方的yum源进行安装,默认的版本是5.1.6,需要升级。但是因为不是一个非常正式的服务器环境,所以想通过简单的yum update一下了事。但是很不幸,CentOS的官方默认YUM源不提供直接的升级,因为CentOS一向以稳定著称,所以在他的源里面,提供的一般都是经过千锤百炼的版本。

但是CentOS并不是裹足不前的,他同时提供了一个开发源,通过这个开发源,我们可以轻松的安装一些比较新潮的版本。

在系统中添加开发源的方法比较简单,下面是具体步骤:

1、首先创建一个单独的源文件

# /etc/yum.repos.d/CentOS-Testing.repo

2、在文件中添加如下信息

# CentOS-Testing: # !!!! CAUTION !!!! # This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras. # They may or may not replace core CentOS packages, and are not guaranteed to function properly. # These packages build and install, but are waiting for feedback from testers as to # functionality and stability. Packages in this repository will come and go during the # development period, so it should not be left enabled or used on production systems without due # consideration. [c5-testing] name=CentOS-5 Testing baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing includepkgs=php*

代码语言:javascript
复制
3、完成后我们就可以使用这个源了,可以简单的 yum update ,也可以指定更新指定的软件
代码语言:javascript
复制
最后,确认一下系统中已经安装了PHP 5.2

# rpm -qa |grep php php-cli-5.2.6-2.el5s2 php-mbstring-5.2.6-2.el5s2 php-devel-5.2.6-2.el5s2 php-pdo-5.2.6-2.el5s2 php-gd-5.2.6-2.el5s2 php-dba-5.2.6-2.el5s2 php-common-5.2.6-2.el5s2 php-bcmath-5.2.6-2.el5s2 php-xml-5.2.6-2.el5s2 php-pear-1.5.1-2.el5s2 php-ldap-5.2.6-2.el5s2 php-5.2.6-2.el5s2 php-mysql-5.2.6-2.el5s2 # php -v PHP 5.2.6 (cli) (built: Sep 15 2008 20:42:05) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

参考资料:

1、pcre-6.6.2.el5_1.7.src.rpm

2、Build PCRE RPM with Unicode Support

3、How to patch and rebuild RPM package

4、How To PHP5.1-PHP5.2

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2010-08-04 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档