Pcre does not support UTF issues

Source: Internet
Author: User

problem: Error Preg_match (): compilation failed:this version of PCRE is compiled without UTF support at offset 0 Specific Analysis: Environment: Centos7,lnmp,nginx and PHP-FPM are all Yum installed, Pcre has been installed
Began to think that is the problem of Nginx compilation, recompile, No. The final discovery is pcre compile a problem, pcre7.9 above version, default is not support Unicode, UTF-8, to recompile manually specified--enable-utf8 Workaround

PCRE (perl Compatible Regular Expressions) is a Perl library that includes a Perl-compatible regular expression library. These are useful for using the same syntax and semantics as Perl 5 when performing regular expression pattern matching, and can also be used to solve problems with the use of regular expressions in the C language.

Pcre:https://sourceforge.net/projects/pcre/files/pcre/

To recompile the installation pcre:

1. Download pcre-8.38.tar.gz

2. Decompression

tar zxvf pcre-8.38. tar. gz
# CD pcre-8.38

3. Compile and install (Specify:--enable-utf8--enable-unicode-properties)

#./configure--enable-utf8--enable-unicode-properties
# make
# make Install

When the Pcre is installed, the pcretest command is used to print the installation of the Pcre, the general output is as follows:

# pcretest-Cpcre version8.38  -- One- atCompiled with8-bit support UTF-8Support for Unicode properties support No just-inch- Timecompiler support Newline sequence is LF \ r matches all Unicode newlines Internal link size=2POSIX malloc Threshold=TenParentheses Nest Limit= -Default Match Limit=10000000Default Recursion Depth Limit=10000000Match recursion uses stack

Reference: http://www.cnblogs.com/pcat/p/5520317.html

Pcre does not support UTF issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.