Compilation failed: this version of PCRE is not compiled with PCRE_UTF8 support at offset 0

在安装pcre-8.13.tar.gz时候出了错,说是缺少libpcre.so.0 下面是解决方法。真不容易哦,一个问题来没解决,新问题就出来了。一环扣一环,会搞死去。。

error
grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
缺少libpcre.so.0文件 要下载这个文件,如果系统是32位的,则需要把这个文件放在/lib目录下;如果系统是64位的,则要把它放在/lib64目录下

可下以载pcre-7.8-6.el6.x86_64.rpm 这个文件进入安装 ,安装后系统的/lib64目录下会自动添加libpcre.so.0文件

下面是正式解决方法

linux下安装软件
1、下载原文件pcre-8.13.tar.gz
2、解压文件(可以解压到指定目标)
tar zxvf pcre-8.13.tar.gz
cd pcre-8.13 #切换到文件解压所在目标
3、设置
./configure --enable-utf8 --enable-unicode-properties
4、
make
make install

安装完成后,重生编译php

../configure --prefix=/home/web/php-5.4/ --with-apxs2=/home/web/apache/bin/apxs --with-mysql=mysq安装路径
--with-config-file-path=/home/web/php-5.4/ --enable-mbstring

注意--with-apxs2=/home/web/apache/bin/apxs作用是
会在 /home/web/apache//modules 目录下生成一个 libphp5.so, 并且在httpd.conf 中会自动加上
LoadModule php5_module modules/libphp5.so 这句

原文地址:https://www.cnblogs.com/longhs/p/4449075.html