Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5381468
  • 博文数量: 890
  • 博客积分: 12876
  • 博客等级: 上将
  • 技术积分: 10760
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-04 14:18
个人简介

猝然临之而不惊,无故加之而不怒。

文章分类

全部博文(890)

文章存档

2016年(1)

2014年(18)

2013年(41)

2012年(48)

2011年(65)

2010年(84)

2009年(121)

2008年(101)

2007年(129)

2006年(95)

2005年(118)

2004年(69)

分类: LINUX

2011-05-25 15:48:10

From:

CentOS 5.4 的官方網站的PHP一直停留在5.1.6,今天索性用了Google大神搜尋了一下,找到了更新的方法。

升級法一:

參考網站:

http://blog.ckps.hc.edu.tw/post/4/2965

 

php與mysql升級過程紀錄:

1.下載安裝 epel 套件:
下載:wget
 
安裝:rpm -ivh epel-release-5-3.noarch.rpm

2.下載安裝 remi 套件:
下載:wget
安裝:rpm -ihv remi-release-5-7.el5.remi.noarch.rpm

3.更新PHP、MySQL套件:
yum --enablerepo=remi update php mysql

PHP從5.1.6升級至5.3.1
MySQL從5.0.77升級至5.1.44

 

重新啟動Apache,MySQL,學務系統主機測試OK,除的一些自己開發的小程式出現小問題,修正後一切順利。

 

接著繼續更新其他的伺服器,殘念-->ostube、班級網頁e-class出現一些函數不支援的錯誤,php5.3.1之後,一些函數已不支援,只好再降回php5.1.6

php與mysql降級過程記錄: 

 

1.移除php-->yum remove php

2.移除mysql-->yum remove mysql

3.移除被remi更新的相關套件-->yum remove *remi

5.檢查有無之前更新的remi安裝的套件(rpm -qa|grep remi),若有記得利用(yum remove *remi)移除,或是用(rpm -e)手動移除。

4.移除epel與remi:
yum remove epel-release-5-3  -->  會將相關套件 remi-release-5-7 一起移除。

5.利用yum install 裝回php與mysql
yum install php 
yum install mysql

6.檢查設定檔與相關的套件

7.重新啟動Apache與mysql

 


升級法二:

1.從官網(http://dev.centos.org/centos/5/)下載CentOS-Testing.repo檔案(http://dev.centos.org/centos/5/CentOS-Testing.repo)至/etc/yum.repos.d/目錄下

2.CentOS-Testing.repo檔案內容
##########################################
[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

# 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. 
##########################################


將CentOS-Testing.repo檔案內的enabled=0 改成 enabled=1啟動這個repo

3.
※先備份php.ini、httpd.conf、my.cnf
※yum install php-->php5.1.6升級至php5.2.10 
※yum update   httpd也有更新(從2.2.3-->2.2.8)結果httpd.conf設定檔恢復成預設值 --> 將備份檔覆蓋httpd.conf,然後restart httpd 

其他機器利用此方法升級至php5.2.10 --> ostube、lifetype1.2.8、e-class班級網頁正常OK ^-^

參考網站:http://www.wretch.cc/blog/jerry0822/16159621

阅读(3793) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~