PHP 5.1.0 Release
ついに PHP 5.1.0 がリリースとなったので、PHP: UPGRADE NOTES – PHP 5.1 に一通り目を通してから いつもの手順で PowerBook にインストール。各種ライブラリは DarwinPorts で、MySQL はソースからビルドして入れてあります。SAPI は FastCGI とデフォルトの CLI を選択。
PHP 5.0.5 は gcc 3.3 でないとコンパイルエラーが発生していましたが、今回は 4.0.1 でも問題ありませんでした。
$ ./configure --prefix=/usr/local/php/php-5.1.0 \
--with-bz2=/opt/local \
--with-gd \
--with-jpeg-dir=/opt/local \
--with-png-dir=/opt/local \
--with-zlib-dir=/opt/local \
--with-freetype-dir=/opt/local \
--with-t1lib=/opt/local \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-mbregex \
--with-mysql=/usr/local/mysql/mysql-4.1.15 \
--with-mysqli=/usr/local/mysql/mysql-4.1.15/bin/mysql_config \
--enable-pcntl \
--with-pgsql=/usr/local/pgsql \
--with-readline=/opt/local \
--enable-soap \
--with-xmlrpc \
--with-xsl=/opt/local \
--enable-zend-multibyte \
--enable-fastcgi \
--enable-discard-path \
--enable-force-redirect \
--enable-cgi-force-redirect
$ make
$ make test
=====================================================================
TIME END 2005-11-26 17:26:54
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 56
Exts tested : 21
---------------------------------------------------------------------
Number of tests : 1889 1185
Tests skipped : 704 ( 37.3%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 4 ( 0.2%) ( 0.3%)
Tests passed : 1181 ( 62.5%) ( 99.7%)
---------------------------------------------------------------------
Time taken : 361 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #30638 (localeconv returns wrong LC_NUMERIC settings) [tests/lang/bug30638.phpt]
Sort with SORT_LOCALE_STRING [ext/standard/tests/array/locale_sort.phpt]
zlib.deflate (with convert.base64-encode) [ext/zlib/tests/zlib_filter_deflate.phpt]
zlib.inflate (with convert.base64-decode) [ext/zlib/tests/zlib_filter_inflate.phpt]
=====================================================================
まずは FastCGI 版をインストール。
$ sudo make install
FastCGI 版は $prefix/bin/php としてインストールされますが、ここには後で CLI 版をインストールするので FastCGI 版の実行ファイルを php-fastcgi とリネームしておきます。
$ sudo mv /usr/local/php/php-5.1.0/bin/php /usr/local/php/php-5.1.0/bin/php-fastcgi
私は PHP は独特の手法でインストールしていますので、それ用に php-fastcgi へのシンボリックリンクも作成。
$ sudo ln -s /usr/local/php/current/bin/php-fastcgi /usr/local/bin/php-fastcgi
そして CLI 版をインストール。
$ sudo make install-cli
以上で $prefix/bin/php が CLI 版、$prefix/bin/php-fastcgi が FastCGI 版となりました。lighttpd などから FastCGI 版を呼び出す際は $prefix/bin/php-fastcgi を指定すれば CLI 版と使い分けることができます。
なお、eAccelerator のほうはフォーラムの Can’t compile with PHP 5.1 を読む限りまだ対応できていないようなので、このサーバは 5.0.5 のままにしています。
