概述

由于PHP7.4安装时启用了--with-external-pcre选项,但系统安装的pcre2版本默认为10.23低于php要求的10.30。

报错内容
Requested 'libpcre2-8 >= 10.30' but version of libpcre2-8 is 10.23

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PCRE2_CFLAGS
and PCRE2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解决办法

前往pcre2官方github库下载合适的版本安装包:https://github.com/PhilipHazel/pcre2/releases

[root@zabbix ~]# wget https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.38/pcre2-10.38.tar.gz
[root@zabbix ~]# tar zxf pcre2-10.38.tar.gz 
[root@zabbix ~]# cd pcre2-10.38/
[root@zabbix pcre2-10.38]# ./configure --prefix=/usr/local/pcre2 --enable-pcre2-16 --enable-pcre2-32 --enable-jit --enable-jit-sealloc
[root@zabbix pcre2-10.38]# make -j 4&make install
[root@zabbix pcre2-10.38]# export PKG_CONFIG_PATH=/usr/local/pcre2/lib/pkgconfig/
END

本文标题:PHP7.4安装pcre库时初始化开始编译时失败

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202109316.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2021 年 11 月 09 日
如果觉得我的文章对你有用,请随意赞赏