PCRE编译时没有UTF支持

Rom*_*miC 6 php apache pcre freebsd

大家!FreeBSD noobie正在寻找一些帮助,将PCRE和Apache与mod_php集成在一起.

是)我有的:

  • FreeBSD 8.2-RELEASE-p3
  • Apache/2.2.22(FreeBSD,从ports构建)
  • PHP 5.3.10与Suhosin-Patch(cli)(内置:2012年4月6日02:58:27)(不是来自端口)
  • PCRE版本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
    
    Run Code Online (Sandbox Code Playgroud)

php -i | grep -i pcre 告诉我,他使用下面的PCRE版本:

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
Run Code Online (Sandbox Code Playgroud)

当我尝试从命令行运行我的php应用程序时,一切正常php < somecode.php.

但是当我通过apache执行它时,我收到此错误: Compilation failed: this version of PCRE is compiled without UTF support at offset 0

我试图从端口重建apache --with-pcre=/usr/local/bin,但失败的消息是apache无法找到pcre-config脚本.

什么可能是错的?

Rom*_*miC 4

解决的问题只是使用系统 pcre 而不是默认值重建 apache。要执行相同的操作,请使用选项构建 apache --with-pcre,该选项应包含包含 pcre-config 本身的完整路径pcre-config。就我而言,它是--with-pcre=/usr/local/bin/pcre-config.

谢谢大家)