Results 1 to 8 of 8

Thread: PCRE with UTF8 Support

  1. #1
    daveturk NNTP User

    Default PCRE with UTF8 Support

    I am getting the following error in some of my sites.

    SUSE 11.1
    pcre-7.8-1.26
    apache2-2.2.10-2.5
    php5-5.2.9-0.1.1

    Warning: preg_replace() [function.preg-replace]: Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0

    My question how can I enable UTF8 support for PCRE. From what I have read, it is a matter of compiling the binaries with the appropriate switch turned on. What is the easiest way to solve this issue.

    Is there already PCRE rpm's with UTF8 support that I can install.

    Thanks in advance.

    Dave

  2. #2
    Join Date
    Jun 2008
    Location
    /dev/swat
    Posts
    1,181

    Default Re: PCRE with UTF8 Support

    Linux[openSUSE, KDE], PHP, MySQL, Wordpress, Tech News, etc :
    http://anl4u.com

  3. #3
    daveturk NNTP User

    Default Re: PCRE with UTF8 Support

    I have built another RPM

    rpmbuild --rebuild --with enable-utf8 pcre-7.8-1.38.src.rpm

    and installed it, but still I get the same error. I have found reference to the fact that it must also be enabled at runtime.

    Quote
    . If you want to make use of the support for UTF-8 Unicode character strings in
    PCRE, you must add --enable-utf8 to the "configure" command. Without it, the
    code for handling UTF-8 is not included in the library. Even when included,
    it still has to be enabled by an option at run time.
    When PCRE is compiled
    with this option, its input can only either be ASCII or UTF-8, even when
    running on EBCDIC platforms. It is not possible to use both --enable-utf8 and
    --enable-ebcdic at the same time.

    I really must be missing something. I cannot be the only person having this problem.


    Can someone tell me where to enable this.

    Thanks,
    Dave

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PCRE with UTF8 Support

    I don't know the extension in question but probably php.ini. Note that there are two php.ini's, one for the CLI interpreter and one for the Apache module. Look under /etc/php5/

  5. #5
    daveturk NNTP User

    Default Re: PCRE with UTF8 Support

    I'm not sure I completely understand what is going on. When I run

    pcretest -C

    I get

    PCRE version 6.6 06-Feb-2006
    Compiled with
    No UTF-8 support
    No 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

    But I have installed the RPM for pcre-7.8-1.38.i586.rpm which I compiled from a source RPM and know that is has UTF-8 support.

    How can this be and how can I fix this?
    Shouldn't this have upgraded the system PCRE?

    I just checked an old shop machine with SUSE 10.3 and pcretest -C shows
    CRE version 7.8 2008-09-05
    Compiled with
    UTF-8 support
    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

    Which matches the rpm installed!!!!!!!!!

    On thing to note is that this system began life as a SUSE 9.x can't remember(some years ago). But now is SUSE 11.1 and throught the years I don't remember any real errors. I must have missed it.

    I must need to force something to fix this.
    Once again I must be missing something but I feel I am close to figuring it out.

    Thanks very much for any help anyone can provide,
    Dave

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PCRE with UTF8 Support

    That sounds like you have two versions of pcretest floating around. Do:

    which -a pcretest

  7. #7
    daveturk NNTP User

    Smile Re: PCRE with UTF8 Support

    Fixed -- Resolved. I found that for some reason in 2006 I had installed a tar-ball(PCRE version 6.6)

    running

    make uninstall

    then reinstalling the rpm's using --force has fixed my current issue.

    Thanks to all who responded. Hopefully what I went thru might be helpful to someone else.

    Thanks,
    Dave

  8. #8
    JosephKK NNTP User

    Default Re: PCRE with UTF8 Support

    On Wed, 26 Aug 2009 14:36:02 GMT, daveturk
    <daveturk@no-mx.forums.opensuse.org> wrote:

    >
    >Fixed -- Resolved. I found that for some reason in 2006 I had
    >installed a tar-ball(PCRE version 6.6)
    >
    >running
    >
    >make uninstall
    >
    >then reinstalling the rpm's using --force has fixed my current issue.
    >
    >Thanks to all who responded. Hopefully what I went thru might be
    >helpful to someone else.
    >
    >Thanks,
    >Dave


    Issues like this is why i quit installing from tarballs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •