PHPのインストールメモ
以前、他のBLOGを使って書いていたもの
PHP4/PHP5のインストールを行います。
ApacheのLoadModuleで、PHP4/PHP5を切り替えて使うよう方法です。
PHP3/PHP4の時のような共存は無理のようです。
他にReverseProxyを使って、URIで判別して、PHP4/PHP5を
ロードしているApacheに処理を投げる方法もあります。
(それはまた後日。。。)
(2005-4-18 XML関連のサポートについて追加)
PHP4
#./configure --with-apxs2=/usr/local/apache2/bin/apxs \ --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql \ --enable-mbstring --enable-mbregex --with-gd --program-suffix=4 \ --with-pear=/usr/local/lib/php4/pear --sysconfdir=/usr/local/lib/php4/etc \ --with-zlib-dir=/usr --with-jpeg-dir=/usr --with-config-file-path=/usr/local/lib/php4 \ --with-dom=/usr/local --with-xml=/usr/local --with-dom-xslt=/usr/local \ --with-dom-exslt=/usr/local --with-xmlrpc # make # make install # cp php.ini-recommand /usr/local/lib/php4/php.ini
PHP4用のpearコマンドラッパー作成
# vi /usr/local/bin/pear4 #!/bin/sh PHP_PEAR_PHP_BIN=/usr/local/bin/php4 PHP_PEAR_INSTALL_DIR=/usr/local/lib/php4/pear /usr/local/bin/pear $@
PHP5
#./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin \ --without-mysql --with-pgsql=/usr/local/pgsql --enable-mbstring --enable-mbregex \ --with-gd --program-suffix=5 --with-pear=/usr/local/lib/php5/pear \ --sysconfdir=/usr/local/lib/php5/etc --with-zlib-dir=/usr --with-jpeg-dir=/usr \ --with-config-file-path=/usr/local/lib/php5 --with-dom=/usr/local --with-xml=/usr/local \ --with-dom-xslt=/usr/local --with-dom-exslt=/usr/local --with-xmlrpc # make # make install # cp php.ini-recommand /usr/local/lib/php5/php.ini
PHP5用のpearコマンドラッパー作成
# vi /usr/local/bin/pear5 #!/bin/sh PHP_PEAR_PHP_BIN=/usr/local/bin/php5 PHP_PEAR_INSTALL_DIR=/usr/local/lib/php4/pear /usr/local/bin/pear $@