You are not logged in.

#1 2010-10-09 11:10:17

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

php, php-apache: PCRE is not compiled with UTF-8 support

Hello everybody,

I want to use nette framework for my PHP application. I have big problem with this framework - this framework needs PCRE with UTF-8 support.
I am using this version of Apache/2.2.16 (Unix)
and this version of PHP/5.3.3 with Suhosin-Patch.


It shows this error:
preg_match(): Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0

I found this simple test to check UTF-8 support:
<?php
if (@preg_match('/\pL/u', 'a') == 1) {
echo "PCRE unicode support is turned on.\n";
} else {
echo "PCRE unicode support is turned off.\n";
}
?>

I am confused with correct PCRE version.

phpinfo() shows me this informations
PCRE (Perl Compatible Regular Expressions) Support  enabled 
PCRE Library Version  5.0 13-Sep-2004 

and according to this page http://www.php.net/manual/en/pcre.installation.php, the version should be 8.02.

Thank you for help.

Best regards
Tomas

Offline

#2 2010-10-09 19:19:40

sagattarii
Member
Registered: 2008-11-10
Posts: 19

Re: php, php-apache: PCRE is not compiled with UTF-8 support

It seems that you have a wrong pcre lib installed. PHP is using the system pcre library on archlinux. (See --with-pcre-regex=/usr in official php package).

Check "pcre-config --version" on your console. My lib (using the up to date php and pcre packages) ist version 8.10.

-> Try pacman -Syu

Offline

#3 2010-10-10 14:17:41

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: php, php-apache: PCRE is not compiled with UTF-8 support

I have latest system now and before too.

pcre-config --version gives me 8.10

But phpinfo() returns another version.

Tomas

Offline

#4 2010-10-10 14:33:30

sagattarii
Member
Registered: 2008-11-10
Posts: 19

Re: php, php-apache: PCRE is not compiled with UTF-8 support

Are you using the standard php package? Shows phpinfo() "--with-pcre-regex=/usr" under Configure Command? Do you use mod_php, php over fastcgi oder php-fpm?

Offline

#5 2010-10-10 18:01:03

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: php, php-apache: PCRE is not compiled with UTF-8 support

Yes, I am using standard php package. phpinfo() shows --with-pcre-regex=/usr. I am using mod_php.
Tomas

Offline

#6 2010-10-10 18:10:03

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: php, php-apache: PCRE is not compiled with UTF-8 support

Sounds similar to https://bugs.archlinux.org/task/9601. Even though the bug in apache was fixed a long time ago.

Offline

#7 2010-10-11 08:45:39

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: php, php-apache: PCRE is not compiled with UTF-8 support

I found this bug. There was a tip to remove --with-regex from PKGBUILD for PHP but this does not help me.

What change in apache PKGBUILD was made for fixing this problem?

Tomas

Offline

#8 2010-10-11 08:51:02

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: php, php-apache: PCRE is not compiled with UTF-8 support

Apache needs to be compiled with system pcre. I just checked this on my system and pcre is working fine with mod_php.

Offline

#9 2010-10-11 10:30:59

tomas.skocdopole
Member
Registered: 2010-03-28
Posts: 11

Re: php, php-apache: PCRE is not compiled with UTF-8 support

Thank you for you reply!
I am reading this configure manual http://httpd.apache.org/docs/2.2/progra … igure.html but i cant found any configure option about PCRE.

Tomas

Offline

Board footer

Powered by FluxBB