PHP4とPHP5のを両方を共存させたい。

CentOS5
PHP5
Apache2

の環境に

PHP4

を追加でいれれたらいいな〜
とりあえず前のバージョンを以下よりダウンロード

http://jp.php.net/releases/index.php

んで、探してみたらそれっぽい記事がありました。

http://www.phppro.jp/news/60

↓早速やってみる

#wget http://museum.php.net/php4/php-4.3.9.tar.bz2
#tar jxfv php-4.3.9.tar.bz2
#cd php-4.3.9

んで上記記事にあるように

#./configure --prefix=/data/php --exec-prefix=/data/php
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

あれ?エラー?ディレクトリがないだけ?

# mkdir /data
# mkdir /data/php

checking for gcc... noってgccがないってこと?

# yum install gcc
#./configure --prefix=/data/php --exec-prefix=/data/php
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... exit 0;
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for mawk... no
checking for gawk... gawk
checking for bison... no
checking for byacc... no
configure: warning: You will need bison if you want to regenerate the PHP parsers.
checking for flex... lex
checking for yywrap in -ll... no
checking lex output file root... ./configure: line 2425: lex: command not found
configure: error: cannot find output from lex; giving up

ちょっと進んだみたいだけど、まだだめみたい

http://nanitozo.com/log/euri/archives/000188.html

#yum install flex
yacc -d ./parse.y
make: yacc: コマンドが見つかりませんでした
make: *** [parse.c] エラー 127
#yum install bison 
#yum install byacc
#make

んで再チャレンジ

#./configure --prefix=/data/php --exec-prefix=/data/php
中略
Thank you for using PHP.

きたー!できたっぽい。

#make
中略
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

多分大丈夫・・・
でとりあえずバーチャルホストの設定書き換え