・apt-get install php5 したがphpinfo()ではphp4のまま表示された。
・apt-get remove php を実行したらphp4は削除される。
(http://www.yamada-lab.org/doc/linux/php5/にあるように、PHP4を残したままPHP5も入れられる?)
・http://www.yamada-lab.org/doc/linux/php5/に従いphp5をダウンロードしてインストールした。
・拡張モジュールはhttp://tsuttayo.sytes.net/php/install2/source.php?ver=5.0.1&os=Vine+Linux+2.6r4
のフォームに従うが、パスが違っていたり存在しないパッケージ(?)があるのでいくつかのオプションは削除してconfigureした。
■その他の参考サイト
http://blog.teachat.org/archives/25170371.html、
http://www.kiwameru-php.net/install/linux.php、
↓
■結局「apt-get remove php」を実行したのがまずかったような気がする。
#apt-get update
#apt-get install libxml2-devel
#apt-get install libxslt-devel
#apt-get install mysql-devel
→http://www.yuyuyu.jp/other/Linux/index2.htmに従い、下記で大体OKなはず。(configureのオプションは、'./configure' '--enable-ftp' '--enable-mbstring' '--enable-zend-multibyte' '--with-apxs2' '--with-mysql' とした(←phpinfoで確認できる))
後に追加したオプション --with-gd (←kozaiの画像出力用) --with-mysqli --with-jpeg-dir=/usr/local/lib(←これをつけてもphpinfoで「JPG Support」 が enabledにならないのはなぜ?)
↑オプションは「/usr/local/src/php-5.2.5/php_config_opt.in」に記述して「./configure `cat php_config_opt.in`」でコンフィギュアする
---
#cd /usr/local/src
#tar zxvf php-5.2.5.tar.gz
#cd php-5.2.5
#./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-zend-multibyte --enable-mbstring --enable-mbregex (上の行から改行せずにここまで入力することに注意)
#make
#make install
#cp php.ini-dist /usr/local/lib/php.ini (現状の環境では/etc/php.ini)
上記Apache2のhttpd.confで以下の行を追加します。
LoadModule php5_module modules/libphp5.so (←この行だけhttpd.confに自動的に追加されるようだ)
AddType application/x-httpd-php .php
Apacheサーバを起動しなおす。
#/usr/local/apache2/bin/apachectl restart
---