tags:

views:

540

answers:

2

I am attempting to run a regex on my site, and I am getting this response:

Compilation failed: support for \P, \p, and \X has not been compiled at offset 1

After googling for a bit, I've found that apparently my PCRE on my server is not UTF8 enabled, and is therefore causing problems. When I ssh with pcretest -C I get

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

When I do yum update pcre it tells me that there isn't anything to update.

People are telling me that I can turn on UTF-8 support...help?

I am a noob.

+1  A: 

PHP doesn't use the "prce" application/package. PCRE support is built in to the PHP libraries. The error you're getting is telling you that your PHP libraries were not compiled with PCRE UTF-8 support.

You'll need to recompile PHP with the proper PCRE static library built with the proper UTF-8 option.

SoapBox
okay, that is cool...not to be nuts, but since im really new at this...is there a good newbie tutorial that will show me how to recompile? thanks for your patience...i know its prolly a dumb question
johnnietheblack
Honestly I've never had to do it so I really don't know. Usually it is pretty easy (usually: get the source, untar it, do a configure, then a make, and then a make install). The tricky part is having all of the pre-requisites. And you'll possibly need to re-make libpcre. It is also possible that you *only* need to remake libpcre and not touch php at all. I'm not sure if php has it statically linked, or dynamically.
SoapBox
+1  A: 

There's a good tutorial on rebuilding the RPM for pcre here.

If you scroll down to "Updated RPM file for..." you'll find some pre-built RPM's if you just want it to work (remember to restart Apache after you're done, not just a graceful reload).

The tl;dr version is: recompile pcre with --enable-utf8 and --enable-unicode-properties

Owen