2010年9月20日月曜日

[設定]さくらVPSのPHP 5.1 To 5.2

さくらVPSのCentOSでのphpバージョンは5.1.*なので、5.2.*のUpgradeするときに行った作業を記しておく。
本家のここを参考に作成しました。

作業の流れ

  1. バージョンの確認

  2. リポジトリの作成

  3. yum実行

  4. 確認


と5分程度でUpgradeができる。

一番のphpのバージョンを確認
[code]rpm -qa |grep php[/code]

次にリポジトリの作成
[code]touch /etc/yum.repos.d/CentOS-Testing.repo
vi /etc/yum.repos.d/CentOS-Testing.repo
[/code]
リポジトリの中に記述するもの(コピペするのが良い)
[code]
[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*
[/code]
そしてyumアップデート実行
[code]yum update[/code]

するとアップデートが実行され1分くらい、アップデートされる。

念のためWebサーバーを再起動
[code]/etc/init.d/httpd restart[/code]

アップデートの確認
upgrade_php

これで完了!!