PCRE is compiled without UTF support

Go To StackoverFlow.com

6

everyone! FreeBSD noobie looking for some help with integration of PCRE and Apache with mod_php.

What I have:

  • FreeBSD 8.2-RELEASE-p3
  • Apache/2.2.22 (FreeBSD, built from ports)
  • PHP 5.3.10 with Suhosin-Patch (cli) (built: Apr 6 2012 02:58:27) (not from ports)
  • PCRE version 8.30 2012-02-04

    Compiled with
      8-bit support only
      UTF-8 support
      Unicode properties support
      No just-in-time compiler support
      Newline sequence is LF
      \R matches all Unicode newlines
      Internal link size = 2
      POSIX malloc threshold = 10
      Default match limit = 10000000
      Default recursion depth limit = 10000000
      Match recursion uses stack
    

php -i | grep -i pcre tells me, he uses version of PCRE below:

Configure Command =>  './configure'  '--with-layout=GNU' 
                      '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' 
                      '--disable-all' '--enable-libxml' '--enable-mysqlnd' 
                      '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local/lib' 
                      '--with-zlib-dir=/usr' '--program-prefix=' '--with-apxs2=/usr/local/sbin/apxs' 
                      '--with-regex=php' '--with-zend-vm=CALL' 
                      '--enable-zend-multibyte' '--prefix=/usr/local' 
                      '--mandir=/usr/local/man' '--infodir=/usr/local/info/' 
                      '--build=i386-portbld-freebsd8.2'
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.30 2012-02-04
pcre.backtrack_limit => 1000000 => 1000000
pcre.recursion_limit => 100000 => 100000

And everything works fine, when I try to run my php application from command line, in such way php < somecode.php.

But when I execute it via apache, I receive this error: Compilation failed: this version of PCRE is compiled without UTF support at offset 0

I've tried to rebuild apache from ports with --with-pcre=/usr/local/bin, but its failed with message that apache couldn't find pcre-config script.

What's could be wrong?

2012-04-05 23:16
by RomiC
Have a look at this answer to a very similar question - wallyk 2012-04-06 07:00
@wallyk, thanks! But it's not my variant. I've already recompiled PCRE with utf and unicode support and it works fine with php in cli-mode. My problem is in apache pcre-module, if I understood right - RomiC 2012-04-06 08:43
Did you check that the php on the apache is the same, as the one from the commandline? Maybe you have a second version. Also check, maybe there are two versions of pcre installed - arved 2012-04-06 09:06
Yes, I've just checked. Via pkg_info I found only one php5-5.3.10_1 and one pcre-8.30_1 - RomiC 2012-04-06 12:53
Did you try rebuilding apache module - arrowd 2012-04-06 16:58
@arrowdodger, yes. Nothing changes - RomiC 2012-04-11 12:45


4

Resolved problem just rebuilt apache with system pcre instead of default. To do the same, built your apache with --with-pcre option, which should contain the full path to pcre-config including pcre-config itself. In my case it's --with-pcre=/usr/local/bin/pcre-config.

Thanks to all)

2012-04-11 20:39
by RomiC
Thanks for following up - wallyk 2012-04-11 20:50
Ads