purazumakoiの[はてなブログ]

技術メモから最近はライフログも増えてきてます。

CloudCore VPS CV01を使ってみた その3 suPHPでphp4.4、5.2、5.3を同居させる

こいつらの続きです。

suPHPをいれて、php4.4、5.2、5.3を同居させたい。

  • phpはモジュール版ではなくCGI版
  • php4.4.9 と MySQL4.0.27
  • 5.2.17、5.3.6 とMySQL5.1.x

この条件で動かすつもり

必要なモジュールをインストール、phpのソースをDL

# cd /root/
mod_ssl、openssl-develをインストール
# yum -y install mod_ssl openssl-devel

開発者ツールをインストール 何か聞かれますがYで許可
# yum groupinstall 'Development tools'
wgetコマンドがないようなのでインストール
# yum -y install wget

PHP5.3.6をDL
# wget http://museum.php.net/php5/php-5.3.6.tar.gz
PHP5.2.17をDL
# wget http://museum.php.net/php5/php-5.2.17.tar.gz
PHP4.4.9をDL
# wget http://museum.php.net/php4/php-4.4.9.tar.gz

もろもろインストール。既にはいってるのもあるが既にあるよって言われるだけなので気にしない。
# yum -y install libxml2 libxml2-devel
# yum -y install bzip2 bzip2-devel bzip2-libs
# yum -y install libjpeg libjpeg-devel
# yum -y install libpng libpng-devel
# yum -y install freetype freetype-devel
# yum -y install libtool-ltdl-devel
# yum -y install aspell-devel

EPEL をリポジトリのパッケージが要るようなのでEPEL導入
# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
# rpm --import RPM-GPG-KEY-EPEL-6
# rm -f RPM-GPG-KEY-EPEL-6 
# vi /etc/yum.repos.d/epel.repo

新規作成
#↓------
[epel]
name=EPEL RPM Repository for Red Hat Enterprise Linux
baseurl=http://ftp.riken.jp/Linux/fedora/epel/6/$basearch/
gpgcheck=1
enabled=0
#--------↑


# yum --enablerepo=epel -y install libmcrypt libmcrypt-devel libmhash libmhash-devel
# yum --enablerepo=epel -y install mysql-devel
# yum --enablerepo=epel -y install postgresql-devel

PHP5.3.6のインストール

# tar zxvf php-5.3.6.tar.gz
# cd php-5.3.6

↓以下一気にコピペ
./configure \
--prefix=/usr/local \
--program-suffix=-5.3.6 \
--disable-debug \
--disable-ipv6 \
--enable-calendar \
--enable-cli \
--enable-discard-path \
--enable-ftp \
--enable-gd-jis-conv \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-soap \
--enable-sqlite-utf8 \
--enable-zip \
--enable-zend-multibyte \
--with-libdir=lib64 \
--with-bz2 \
--with-config-file-path=/usr/local/etc/php_conf_5.3.6 \
--with-freetype-dir=/usr/lib64 \
--with-gd \
--with-gettext \
--with-iconv \
--with-jpeg-dir=/usr/lib64 \
--with-mcrypt \
--with-mhash \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-pdo-sqlite \
--with-pgsql \
--with-png-dir=/usr/lib64 \
--with-pspell \
--with-zlib \
--without-pear

makeはなかなか時間がかかります。
# make
make testも結構時間がかかります。
# make test
今レポートを送信しますか?とか聞かれるので
# no
インストール
# make install

インストール先情報
#!======================================================
Installing PHP SAPI module:       cgi
Installing PHP CGI binary: /usr/local/bin/
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize-5.3.6
  program: php-config-5.3.6
Installing man pages:             /usr/local/man/man1/
  page: phpize-5.3.6.1
  page: php-config-5.3.6.1
/root/php-5.3.6/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/
#!=====================================================

php.iniを置く場所を作る
# mkdir /usr/local/etc/php_conf_5.3.6
# cp php.ini-development /usr/local/etc/php_conf_5.3.6/php.ini

PHP5.2.17のインストール

# cd /root/
# tar zxvf php-5.2.17.tar.gz
# cd php-5.2.17

↓以下一気にコピペ
./configure \
--prefix=/usr/local \
--program-suffix=-5.2.17 \
--disable-debug \
--disable-ipv6 \
--enable-calendar \
--enable-cli \
--enable-discard-path \
--enable-ftp \
--enable-gd-jis-conv \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-soap \
--enable-sqlite-utf8 \
--enable-zip \
--enable-zend-multibyte \
--with-libdir=lib64 \
--with-bz2 \
--with-config-file-path=/usr/local/etc/php_conf_5.2.17 \
--with-freetype-dir=/usr/lib64 \
--with-gd \
--with-gettext \
--with-iconv \
--with-jpeg-dir=/usr/lib64 \
--with-mcrypt \
--with-mhash \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pdo-mysql \
--with-pdo-pgsql \
--with-pdo-sqlite \
--with-pgsql \
--with-png-dir=/usr/lib64 \
--with-pspell \
--with-zlib \
--without-pear

makeはなかなか時間がかかります。
# make
make testも結構時間がかかります。
# make test
今レポートを送信しますか?とか聞かれるので
# no
インストール
# make install

php.iniを置く場所を作る
# mkdir /usr/local/etc/php_conf_5.2.17
# cp php.ini-recommended /usr/local/etc/php_conf_5.2.17/php.ini

長くなってきたのでPHP4.4.9は次で
CloudCore VPS CV01を使ってみた その3 suPHPでphp4.4、5.2、5.3を同居させる の続き - purazumakoiの[はてなブログ]