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