PHP5.3.10がリリースされたということでyumでアップデートしようとしたが、OS標準のリポジトリでは最新バージョンまで上げることが出来ない。PHPやMySQLの最新バージョンはOS標準のリポジトリでは提供されていないため外部リポジトリを導入する必要があるようです。
そこで今回外部リポジトリを導入してみました。
以下はCentOS6.2、64Bitの環境です。
はじめにリポジトリの優先度を設定するyum-prioritiesをインストール
# yum -y install yum-priorities
標準リポジトリを開き"priority=1"を追加
※priority=1~99:低いほど優先が高い。未設定は99。
# vi /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 priority=1 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 priority=1 …
epelインストール
※remiだけインストールすると依存性の欠如でepelを求められる
# rpm --import http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL # rpm -ivh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
remiインストール
# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
epelの設定
enable=0:無効/1:有効
通常は使用しないため"enabled=0"に変更
# vi /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
remiの設定
"priority=1"を追加
# vi /etc/yum.repos.d/remi.repo [remi] priority=1 name=Les RPM de remi pour Enterprise Linux $releasever - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi failovermethod=priority
外部リポジトリの導入は以上です。
以下を参考にさせていただきました。
参考
http://centos.server-manual.com/centos5_repository.html
http://www.tooyama.org/yum-addrepo-remi.html
ここからが本題で外部リポジトリを使用してパッケージをアップデートする場合、たとえばPHPを依存関係も含めてアップデートする場合は以下のように外部リポジトリを指定します。
# yum --enablerepo=remi -y update php
これでめでたくPHP5.3.10にアップデートできますが問題が発生。yumでアップデートするとMySQLも同時にアップデートされMySQL5.1からMySQL5.5にアップデートされます。
MySQL5.5にするとMySQLが起動しません。
MySQL5.5ではシステム変数などの変更で環境が変わるのが原因のようです。
下記のサイトで同様の事象が紹介されています。
http://www.icoro.com/201109206113.html
PHPのパッケージのみを入手してrpmでインストールするか、それともMySQLも同時にアップデートして5.5の環境に変更させるか悩みます…