The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PCRE unicode class problem - php preg_match

Discussion in 'General Discussion' started by ctrLogic.net, Mar 10, 2010.

  1. ctrLogic.net

    ctrLogic.net Registered

    Joined:
    Mar 10, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Why am I not able to use something like:
    PHP:
    preg_match('#([\p{L}]+\s?)+#',$strVar,$matches);
    // unicode class for any letter type (accentuated or not): \p{L}
    Seems like the compiled php isn't using the good PCRE lib.
    Why is that?
    1. a bug?
    2. an extension missing for it to work?
    3. not related to cpanel/whm in any way?
    How to fix this?
    1. recompile PHP myself with good PCRE lib?
    2. can't do a thing about it?

    I've updated Apache+PHP with easyApache, but still not fixed.

    Current:
    Apache: 2.2.15
    PHP: 5.3.2
    PCRE: 8.0
     
  2. thobarn

    thobarn Well-Known Member

    Joined:
    Apr 25, 2008
    Messages:
    153
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    sanctum sanctorum
    Look at the phpinfo "Configure command" section
    Code:
    --with-pcre-regex=/opt/pcre
    . If you do a
    Code:
    /opt/pcre/bin/pcretest -C
    you will see that the utf8 support is not enabled. The latest EasyApache seems to do that. Expect many
    Code:
    warning: preg_...() [function.preg-...]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support...
    warnings in Apache logs every time you use something like \p{L} or /u (lots with 3rd party forum/blog software)

    The latest build source should be in /home/cpeasyapache/src/pcre-8.02 if you wish to reconfigure but manual intervention after every run is not ideal so lets hope there will be an easyapache update soon.
     
  3. Defected

    Defected Member

    Joined:
    Dec 14, 2009
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I had the same problem after updating to Easyapache 5086 last night. Fortunately there was a fix a couple of hours later and know everything works fine.
     
  4. constantine

    constantine Active Member

    Joined:
    Apr 15, 2008
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I have the same problem :

    Code:
    $  /opt/pcre/bin/pcretest -C
    PCRE version 8.02 2010-03-19
    Compiled with
      No UTF-8 support
      No Unicode properties 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
    
    
    
    But already old version installed :
    Code:
    [~]# pcretest -C
    PCRE version 6.6 06-Feb-2006
    Compiled with
      UTF-8 support
      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
    
    
    How can I use it in php ?
     
  5. constantine

    constantine Active Member

    Joined:
    Apr 15, 2008
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    How do you fix the issue ?
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You have rebuild your EasyApache profile. If you haven't modified the profile since the last build, then the following command will do what you need:

    Code:
    # /scripts/easyapache --build
    
     
  7. greengiant

    greengiant Well-Known Member

    Joined:
    Aug 31, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    PCRE UTF8 Support

    Hi,

    The PCRE build is missing the –enable-unicode-properties flag, which is causing "preg_replace_callback() [function.preg-replace-callback]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support" errors still still be displayed even after EasyApache 5090
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Thank you for that. I've reported the matter to an EasyApache dev so he can address it. Apparently the PHP group does not document how they configure PCRE when built internally, so there may be a few more such errors before it gets straightened out.
     
Loading...
Similar Threads - PCRE unicode class
  1. sparek-3
    Replies:
    3
    Views:
    331

Share This Page