PCRE Error on PHP 5.2.x

Recent upgrade to PHP 5.2.8 and PHP 5.2.9 have given me some error on the PCRE/Regex library. That is some sort of bugs I search through the net, so far I still can’t find fixed or patch. After continuously compiling and recompiling of PHP on FreeBSD. I finally found a temporary workaround on the issue.

After upgraded to PHP 5.2.9, I got this error on application that need to use regex/pcre library.

If I run through phpinfo(), I can see PHP is compiled with –with-regex=php. Seem like it’s fine with php regex is configured, and according to PHP 5.2.7 to PHP 5.2.8 upgrade, PCRE is build in PHP package, but unfortunately the error shown is related to PCRE error.

The workaround is recompile the PHP with “-with-pcre-regex=yes”. After recompile your application should work like normal again.

Let me know if you have other workaround.