CentOS で yum を使って php を 5.2 にバージョンアップする
CentOS などの Linux で、PHP5.2にバージョンアップさせるときyumではアップグレードできるリポジトリが無いためそのままでバージョンアップすることが出来ません。
最近は、phpMyAadminなどでも普通にPHP 5.2 以上を要求してくるようになってきたので 5.2 を比較的容易にバージョンアップさせてみることにしました。
PHP 5.2をインストールするためには c5-testing のリポジトリを追加させます。
# cd /etc/yum.repos.d
# wget https://dev.centos.org/centos/5/CentOS-Testing.repo
--2011-12-02 15:56:37-- https://dev.centos.org/centos/5/CentOS-Testing.repo
Resolving dev.centos.org... 204.15.73.242
Connecting to dev.centos.org|204.15.73.242|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 710 [text/plain]
Saving to: `CentOS-Testing.repo'
100%[================================================>] 710 --.-K/s in 0s
2011-12-02 15:56:37 (67.7 MB/s) - `CentOS-Testing.repo' saved [710/710]
これでリポジトリを取得できました。
次にリポジトリのプリオリティを設定する必要があります。
# vi /etc/yum.repos.d/CentOS-Testing.repo
[c5-testing]
name=CentOS-5 Testing
baseurl=https://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://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
# They may or may not replace core CentOS packages, and are not guaranteed to function pro
# 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 witho
# consideration.
このファイルにプリオリティ設定を追加します。
gpgkey の次の行に 「 priority=1 」を追加します。
gpgcheck=1
gpgkey=https://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
priority=1
# CentOS-Testing:
# !!!! CAUTION !!!!
上記のような感じで追加すればOKです。
これで、アップデートの指定が可能になりました。
yum でのアップデートの指定は
# yum --enablerepo=c5-testing update php
でアップデートが実行されます。
依存性などが発生しなければこれで完了出来るはずです。
関連のありそうなエントリ
この記事に対するコメントはまだ登録されていません。



