CentOSにyumでPHP5.2をインストール
CentOSのyumで入るPHP5.1は勘弁だけど、かといってソースからコンパイルするのも面倒くさい。あと入れるのはいいけど、後から管理するのが嫌になる。ということで、devサーバ(dev.centos.org)のリポジトリを使ってPHP5.2をインストールしてみた。PHP5.3でもよかったけど、とりあえずは5.2系を使いたかったのでPHP5.2で。
あと、devサーバのリポジトリは普段使わないで、一時的にyumのオプションでで利用する用にしてみた。
devサーバのリポジトリを利用できるように設定ファイルを準備。普段は利用しないので、ちゃんと「enabled=0」にしておく。
[root@host ~]# vi /etc/yum.repos.d/CentOS-Testing.repo [root@host ~]# cat /etc/yum.repos.d/CentOS-Testing.repo [centos5-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 priority=1
devサーバのリポジトリを利用してPHP5.2系を確認しておく。
[root@host ~]# yum --enablerepo=centos5-testing info php ... addons | 951 B 00:00 base | 2.1 kB 00:00 centos5-testing | 1.9 kB 00:00 centos5-testing/primary_db | 636 kB 00:00 extras | 2.1 kB 00:00 updates | 1.9 kB 00:00 ... Name : php Arch : x86_64 Version : 5.2.10 Release : 1.el5.centos ...
大丈夫なので、PHP関連をもりもりとインストール。
[root@host ~]# yum --enablerepo=centos5-testing install php php-cli php-common php-devel php-pear php-gd php-mbstring php-pdo php-mysql php-pgsql php-xml php-xmlrpc
ついでにApacheもアップデートしてみる。(既存のバージョンが2.2.3で、devサーバのリポジトリは2.2.8だったので)
[root@host ~]# yum --enablerepo=centos5-testing update httpd