Red Hat Entreprise Linux 5 / CentOS 5の環境で「Unicode properties」のサポートが無いので
preg_matchやpreg_replaceで\pとか使おうとするとPHP Warningが出ます。
PHP Warning: preg_replace() [function.preg-replace]: Compilation failed: support for \\P, \\p, and \\X has not been compiled at offset 16 in
確認するにはpcretest -Cで確認できます。
# pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
No Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
「No Unicode properties support」・・・サポートしてませんね(´д`)
リビルドするのは面倒なのでできものを頂いてきました。
ここからpcre-66-27×86_64.rpmをDLしてインストール。
# wget http://gaarai.com/wp-content/uploads/2009/01/pcre-66-27x86_64.rpm
# rpm -ivh pcre-66-27x86_64.rpm
# /etc/rc.d/init.d/httpd restart
再度pcretest -Cで確認
# pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack
「Unicode properties support」になりました。
PHP Warningも消えたので良しとしよう(笑)



