Install Oniguruma on PPC64LE machine with CentOS

Updated on May 12, 2020

Have you ever tried installing Oniguruma on POWER PC with CentOS 7? Well, I did that and it was a nightmare. I ended up with an error “configure: error: Package requirements (oniguruma) were not met. No package ‘oniguruma’ found” while configuring PHP 7.4.3. Oniguruma is a dependant package for enabling mb_string extension for PHP. So if you need mb_string to be enabled, then there’s no escape from installing Oniguruma.

Here’s the complete error message:

configure: error: Package requirements (oniguruma) were not met:

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.

I thought, installing oniguruma and its development package would solve the issue. The yum install libonig and libonig-devel and oniguruma said no package found. I could find some RPMs here, but those are all failed with glibc version dependencies as shown below:

error: Failed dependencies:
libc.so.6(GLIBC_2.2.5)(64bit) is needed by oniguruma-5.9.1-3.1.el6.x86_64
libc.so.6(GLIBC_2.3.4)(64bit) is needed by oniguruma-5.9.1-3.1.el6.x86_64
libc.so.6(GLIBC_2.4)(64bit) is needed by oniguruma-5.9.1-3.1.el6.x86_64

Well, I do not want to mess up with GLIB version. So I decided to compile Oniguruma from the source.

I downloaded the source from this link. I generated the configure script by running autoconf. But the configuration failed with

./configure: line 2341: syntax error near unexpected token `-Wno-portability'
./configure: line 2341: `AM_INIT_AUTOMAKE( -Wno-portability)'

A user in StackOverflow faced a similar error while compiling GLIBC, but later he suggested to use a different source. Well, it was a hint that the package I had downloaded might have an issue. So I decided to try another version of Oniguruma (version 5.9.6) from this link.

# ./configure --prefix=/usr/local/onig-5.9.6 --exec-prefix=/usr/local/onig-5.9.6
# make
#make install

That’s it! I was able to install Oniguruma successfully. Now, I tried compiling PHP and still ended up with the same error (as shown at the top of this page).

I understand that the configure script is not able to find the references for Oniguruma properly. So I tried setting LD_LIBRARY_PATH and ONIG_LIBS as suggested in the error message. Oops! that didn’t work as well. So I went on to set PKG_CONFIG_PATH environment variable as suggested.

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
# PKG_CONFIG_PATH=/usr/local/onig-5.9.6/lib/pkgconfig/

Well, that did the trick and I was able to configure PHP 7.4.3 successfully. I hope this helps someone out there.

Was this article helpful?

Related Articles

Leave a Comment