YANO's digital garage

Copyright ©YANO All rights reserved. https://www.bravotouring.com/~yano/

Last-modified: 2024-03-20 (水)


[一語一絵/IT系]

php5とrNote / 2009-04-14 (火)

PHP4の賞味期限切れでお尻に火が付いた、MTOS乗り換えプロジェクト

まだ水面下でトライしてたのだが、実は[External]rNote[External]PHP/5.0.1で動作確認済みという話もあるので、ひとまずAthlon64 X2 5000+にパワーアップしたHP Pavilion s3220jp[External]rNotePHP5環境の是非を確認してみる事に。

まずはaptitudePHP5をインストールし、apacheをrestart。

yano@pavilion:~$ sudo aptitude install php5
yano@pavilion:~$ sudo apach2ctl restart
したところ、/var/log/apache2/error.log
/home/yano/public_html/.htaccess: DirectoryIndex not allowed here
が吐かれてたので、/etc/apache2/mods-enabled/userdir.confAllowOverrideにIndexesを追加。

[External]rNoteの管理画面からいそいそと再構築したところ

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 32 bytes)
が出たので、/etc/php5/apache2/php.ini[External]memory-limitを16M→64Mに変更し、ひとまず構築OK。

ところが、うまく展開されない記事がある。割合的には3886件中18件だが、タイトルとタイムスタンプが漏れているエントリもあれば、まるっきり空っぽのエントリもある。何となくマルチバイト文字列処理に問題がありそうな気がしたので、PHP5をソースからインストールする事に。

まずはaptitudeでインストールしたPHP5をアンインストールし、[External]PHP.netから最新版tar ballをget。

yano@pavilion:~$ sudo aptitude remove php5
yano@pavilion:~$ wget http://jp.php.net/distributions/php-5.2.9.tar.bz2
yano@pavilion:~$ tar jxvf php-5.2.9.tar.bz2
早速./configureするわけだが、以下の不足を指摘され随時補充。
yano@pavilion:~$ sudo aptitude install apache2-dev
yano@pavilion:~$ sudo aptitude install libmysqlclient-dev
yano@pavilion:~$ sudo aptitude install libxml2-dev libpng-dev
ようやく./configureが通ったところでbuild&test。
yano@pavilion:~/php-5.2.9$ ./configure --prefix=/usr/local/php-5.2.9 --enable-mbstring=ja --enable-zend-multibyte --enable-mbregex --with-apxs2=/usr/bin/apxs2 --with-mysql=/usr/bin/mysql --with-gd --with-zlib
yano@pavilion:~/php-5.2.9$ make
yano@pavilion:~/php-5.2.9$ make test
以下のようなエラーが15箇所ほど出たが、
FAILED TEST SUMMARY
---------------------------------------------------------------------
Testing declare statement with several type values [Zend/tests/declare_001.phpt]
Zend Multibyte and UTF-16 BOM [Zend/tests/multibyte/multibyte_encoding_003.phpt]
Test gmstrftime() function : usage variation - Checking Preferred date and time representation other than on Windows [ext/date/tests/gmstrftime_variation22.phpt]
Test strftime() function : usage variation - Checking Preferred date and time representation other than on Windows. [ext/date/tests/strftime_variation22.phpt]
Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
Test session_decode() function : variation [ext/session/tests/session_decode_variation3.phpt]
Test session_encode() function : variation [ext/session/tests/session_encode_variation8.phpt]
proc_open [ext/standard/tests/general_functions/proc_open02.phpt]
money_format test [ext/standard/tests/strings/moneyformat.phpt]
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush(). [tests/output/ob_start_basic_unerasable_005.phpt]
SPL: ArrayObject::__construct basic usage with ArrayObject::ARRAY_AS_PROPS. [ext/spl/tests/arrayObject___construct_basic4.phpt]
SPL: ArrayObject::__construct basic usage with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS. [ext/spl/tests/arrayObject___construct_basic5.phpt]
SPL: ArrayObject::exchangeArray() basic usage with object as underlying data store. [ext/spl/tests/arrayObject_exchangeArray_basic3.phpt]
SPL: ArrayObject::setFlags basic usage with ArrayObject::ARRAY_AS_PROPS. [ext/spl/tests/arrayObject_setFlags_basic1.phpt]
正直よくわからないし面倒くさくなってきたので気にせずインストール。
yano@pavilion:~/php-5.2.9$ sudo make install
yano@pavilion:~/php-5.2.9$ sudo apach2ctl restart
結局、良くも悪くも先にaptitudeでインストールしたPHP5と挙動は変わらなかった。orz

現行サーバーのnx9030と比較するとコンテンツ構築時間は半分以下と圧倒的に早くなったものの、検索時間はほぼ半分に留まり期待したほどでもない。やはりAthlon64 X2 5000+のパワーをもってしてもデータベースエンジンの検索効率の方がいいような気がするなぁ。

というわけでMTOS乗り換えプロジェクト再始動。

【参照】
●rNote http://rinn.e-site.jp/rnote/
●PHP: Hypertext Preprocessor http://www.php.net/
●MTOS http://www.movabletype.jp/opensource/