CentOS 5.4 PHP MySQL的升級/降级

本文介绍了一种将 CentOS 5.4 中的 PHP 从 5.1.6 更新到 5.2.4 或更高版本的方法,并记录了整个过程,包括使用 epel 和 remi 套件进行升级和降级的操作步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

From:http://plog.olps.tc.edu.tw/post/1/3661

CentOS 5.4 的官方網站的PHP一直停留在5.1.6,學務系統交流網建議更新至PHP5.2.4以上
今天索性用了Google大神搜尋了一下,找到了更新的方法。

升級法一:

參考網站:

http://blog.ckps.hc.edu.tw/post/4/2965
http://www.pigo.idv.tw/archives/242

 

php與mysql升級過程紀錄:

1.下載安裝 epel 套件:
下載:wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm 
安裝:rpm -ivh epel-release-5-3.noarch.rpm

2.下載安裝 remi 套件:
下載:wget http://rpms.famillecollet.com/el5.i386/remi-release-5-7.el5.remi.noarch.rpm 
安裝: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

阅读(780) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值