2009年7月22日 星期三

this version of PCRE is not compiled with PCRE_UTF8 support

After installing wordpress, I got a lot of these errors in my apache wordpress error log.

PHP Warning: preg_match_all() [function.preg-match-all]:
Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0 in ...

I am running apache 2.2.8 and it uses the built-in version 5 of pcre.

http://httpd.apache.org/docs/2.2/new_features_2_2.html

The problem is that version 5 of pcre does not contain UTF-8 support. So I had to recompile apache with a newer version of pcre. Luckily I have pcre 6.6 already installed on my linux box.

>> rpm -qa |grep -i pcre
pcre-devel-6.6-2.el5_0.1
pcre-6.6-2.el5_0.1
pcre-6.6-2.el5_0.1

So all I had to do is re-compile apache with the “–with-pcre” flag.

./configure --with-pcre

If you don’t know what version of pcre your php is using, create a phpinfo script and hit it with your broswer. You should see…

沒有留言:

wibiya widget