さて、今度は CompletePHP を自力でアップデートするワケですが。。。
こちらも様々なライブラリがオプションで入っています。これもひとつも外さずにアップデートしたいということで。。。
※現行のphp.iniをいじっている場合は、バックアップをとってください。
PHPの最新版を落としてきます。
ダウンロードは
http://www.php.net/から、PHP 4.4.4 (tar.gz) ってヤツです。
ダウンロードしたら、解凍して、作業ディレクトリに入れます。
Apache2の時と同じ /Library/tmp で作業します。
ターミナルを開いて、
% cd /Library/tmp/php-4.4.4
すべてのライブラリをそのまま使いたいため、 configure ファイルを無理矢理書き換えます。
% sed 's/\(LIBS="\)\(-lpspell \$LIBS"\)/\1-laspell \2/' configure > configure.1
% mv configure.1 configure
% chmod a+x configure
で、configureを実行します。
% ./configure --prefix=/Library/PHP4 --enable-shared --with-apxs2=/Library/Apache2/bin/apxs --disable-cgi --enable-magic-quotes --disable-short-tags --with-openssl=/usr --with-zlib-dir=/usr --enable-calendar --enable-exif --enable-ftp --enable-mbstring --enable-sockets --enable-wddx --enable-yp --enable-trans-id --enable-track-vars --with-mysql=/Library/MySQL --with-ldap=/usr --with-iodbc=/Library/PHP4 --with-gettext=/Library/PHP4 --with-gd --with-jpeg-dir=/Library/PHP4 --with-png-dir=/Library/PHP4 --with-tiff-dir=/Library/PHP4 --enable-gd-native-ttf --with-ttf=/Library/PHP4 --with-freetype-dir=/Library/PHP4 --with-t1lib=/Library/PHP4 --without-xpm-dir --with-pdflib=/Library/PHP4 --with-mcrypt=/Library/PHP4 --with-curl=/usr --with-iconv=/usr --enable-mime-magic --with-pspell=/Library/PHP4 --with-expat-dir=/Library/Apache2 --enable-xslt --with-xslt-sablot=/Library/PHP4 --with-xmlrpc --with-dom=/Library/PHP4 --with-dom-xslt=/Library/PHP4 --with-dom-exslt=/Library/PHP4 --enable-dbx --with-imap=/Library/PHP4 --with-imap-ssl=/usr --enable-dbase --with-bz2=/usr --with-java --enable-ucd-snmp-hack --with-mhash=/Library/PHP4 --with-ming=/Library/PHP4 --enable-shmop --with-gmp=/Library/PHP4 --enable-dio --enable-bcmath --enable-dba --with-cdb
(ちょっと時間がかかります..。)
Makefile も書き換えます。
% sed '/INCLUDES/s/^\(.*\)\( -I\/Library\/PHP4\/include \)\(.*\)$/\1 \3 \2/' Makefile > Makefile.1
% mv Makefile.1 Makefile
そして、makeの実行
% make
(ちょっと時間がかかります..。)
% sudo make install
パスワードを聞かれますので答えてください。
(ちょっと時間がかかります..。)
インストールが終わったら、 php.ini をバックアップしていたものと入れ替えて、Apacheを再起動します。
うまくいきました。w
これで、いつでも最新にできますね。。
調子に乗って、 ZendOptimizer や eaccelerator も入れてみようかなぁ。
MAMPには入ってますもんねぇ。↑
あと、 MySQL が 4.0.21 のままなのだが。。
こういうアナウンスもあるのでしばらくそのままにしておくことにした。。(爆