概述

由于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/

分类: PHP