Fix php7.4 no package ‘oniguruma’ found

If you are compiling php7.4 with --with-mbstring, oniguruma is required.

Error Log

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.


Install oniguruma and oniguruma-devel would fix it.

But they are NOT in the offical repo, you could download it from and

For Ubuntu

sudo apt install libonig-dev

For Centos

yum install
yum install


I can’t make sure when the packages will be updated,so you can use the link here to search oniguruma5php and oniguruma5php-devel (only for centos, other distribution should use the link in Solution field)

Replace the links in the scripts to the corresponding binary package,and please leave a message for other readers in the comment area.