Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    1

    Default PCRE unicode class problem - php preg_match

    Why am I not able to use something like:
    PHP Code:
    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. #2
    Member
    Join Date
    Apr 2008
    Location
    sanctum sanctorum
    Posts
    152

    Default

    Quote Originally Posted by ctrLogic.net View Post
    Why am I not able to use something like:
    PHP Code:
    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
    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. #3
    Member
    Join Date
    Dec 2009
    Posts
    17

    Default

    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. #4
    Member
    Join Date
    Apr 2008
    Posts
    35

    Default

    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. #5
    Member
    Join Date
    Apr 2008
    Posts
    35

    Default

    Quote Originally Posted by Defected View Post
    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.
    How do you fix the issue ?

  6. #6
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by constantine View Post
    How do you fix the issue ?
    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
    Kenneth
    Product Manager
    cPanel, Inc.

  7. #7
    Member
    Join Date
    Aug 2003
    Posts
    50

    Default 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. #8
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by greengiant View Post
    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
    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.
    Kenneth
    Product Manager
    cPanel, Inc.

Similar Threads & Tags
Similar threads

  1. [Case 46284] PCRE unicode class issue with PHP 5.3
    By InfiniteNetwork in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 04-04-2012, 05:43 AM
  2. php COM class problem
    By cloudtemple in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-24-2011, 08:10 AM
  3. Unicode library Standard PHP
    By cobro in forum New User Questions
    Replies: 0
    Last Post: 06-28-2008, 09:54 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube