编译安装 php 7.4 no package ‘oniguruma’ found

在 PHP 7.4 中,如果你启用 --with-mbstring,需要安装 oniguruma

错误日志

No package 'oniguruma' found

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

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

解决方法

安装 onigurumaoniguruma-devel 软件包

这两个人软件包没有被添加进大多数软件源中,可以点击 https://pkgs.org/download/oniguruma 下载

Centos 7

直接执行以下命令即可安装

yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64//oniguruma5-6.9.4-1.el7.remi.x86_64.rpm
yum install http://rpms.remirepo.net/enterprise/7/remi/x86_64//oniguruma5-devel-6.9.4-1.el7.remi.x86_64.rpm