2014年1月21日火曜日

中途半端に旧バージョンのphpをcentosにインストールしたい(外部リポジトリだけどolds内にある時)

いまいちyumの仕組みが分かっていないけど、旧バージョンのphp関係をインストールしなければならなくなったので、そのメモ。

今回はcentos5指定だったので、centos5.10(i386版)にphpの旧バージョン5.3をインストール。


ここを参考にする。
http://blog.hello-world.jp.net/?p=584
http://d.hatena.ne.jp/omiyan/20110114/p1

remiリポジトリを登録して、更に

http://rpms.famillecollet.com/enterprise/5/olds/i386/
(URLはremiリポジトリのディレクトリ)
からパッケージをダウンロードしておかなければならない。

外部リポジトリの追加方法は
http://oxynotes.com/?p=4792
を参照。

remi    Fedora プロジェクトのコントリビュータでもある Remi Collet 氏が運営しているリポジトリhttp://www.1x1.jp/blog/2013/12/how-to-install-php-rpm-on-centos-5-and-6-amazone-linux.html
epel    レッドハット(fedoraプロジェクト)提供のリポジトリ。https://fedoraproject.org/wiki/EPEL/ja
ius    PHPとMySQLの普及振興を目的としたリポジトリ。http://iuscommunity.org/pages/About.html

ダウンロードして置かないと、yum install php-5.3*とか入れても、そんなパッケージは無いと怒られる。
釈然としないがそんなものなのだろう(多分oldsの中だからと勝手に推測する)。

i386版なので、参考URLのシェルスクリプトをいじって、i386版をダウンロードするようにする。

#! /bin/bash
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-cli-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-common-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-bcmath-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-dba-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-devel-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-gd-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-imap-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-ldap-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-mbstring-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-mysql-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-odbc-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-pdo-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-pear-1.9.4-7.el5.remi.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-pecl-ncurses-1.0.2-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-pgsql-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-process-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-snmp-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-soap-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-xml-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-xmlrpc-5.3.23-1.el5.remi.i386.rpm
wget http://rpms.famillecollet.com/enterprise/5/olds/i386/php-pecl-apc-3.1.13-3.el5.remi.i386.rpm

ダウンロードできたら、

yum install --enablerepo=remi,epel php-common-5.3.23* php-cli-5.3.23* hp-5.3.23*

とかでインストール。
rpmコマンドでも多分インストールできるが、必要パッケージがないとか言われることがある。


勘所は、
remiだけでなくepelもリポジトリとして登録しておくこと。
なんとremiだけだと、libeditを見つけられずにエラーが出た。
うへえ。

0 件のコメント:

コメントを投稿