[Solved] php -v Error: error while loading shared libraries: libonig.so.5:cannot open share directory

Currently from PHP5 6 when upgrading to PHP 7.4, directly replace the compiled installation package. When entering PHP – V, an error will be reported: error while loading shared libraries: libonig so.5:cannot open share directory

#php -v
#php: error while loading shared libraries: libonig.so.5:cannot open share directory

Solution:

Step 1

Modify /ECT/LD.so.conf and add the following line:

#vim /etc/ld.so.conf
include ls.so.conf.d/*.conf
/usr/local/lib
/usr/local/x264/lib
/usr/local/openssl/lib
/usr/local/python3.7.1/lib

After saving, execute ldconfig

#ldconfig

Step 2:

Install oniguruma lirary

Download:

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-6.8.2-1.el7.x86_64.rpm

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm

oniguruma-6.8.2-1.el7.x86_64.rpm

oniguruma-devel-6.8.2-1.el7.x86_64.rpm

Use the following commands to install

#rpm -ivh oniguruma-devel-6.8.2-1.el7.x86_64
#rpm -ivh oniguruma-6.8.2-1.el7.x86_64

Then run the command PHP – V to display it perfectly

In case of installation error

Generating autotools files.
./autogen.sh: line 6: autoreconf: command not found

Solution:

[root@yjweb oniguruma-6.9.4]# yum install autoconf automake libtool

Similar Posts: