PHP Warning for OCI8 - libclntsh.so.18.1 can not open

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PHP Warning for OCI8 - libclntsh.so.18.1 can not open

Post by ssax »

Why would it not error as the nagios user but error as the root user? That's very strange.

What's the output of this command?

Code: Select all

su -s /bin/bash -c 'php -v' apache
lexisnexis
Posts: 27
Joined: Wed Dec 30, 2015 3:19 pm

Re: PHP Warning for OCI8 - libclntsh.so.18.1 can not open

Post by lexisnexis »

Below is the output of the command, based on each user.

Code: Select all

[nagios@XXX ~]$ sudo su -s /bin/bash -c 'php -v' apache
PHP 5.6.40 (cli) (built: Jan  9 2019 12:34:16) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Code: Select all

[root@XXX ~]# su -s /bin/bash -c 'php -v' apache
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.18.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_oci.so' - libclntsh.so.18.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.40 (cli) (built: Jan  9 2019 12:34:16) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
lexisnexis
Posts: 27
Joined: Wed Dec 30, 2015 3:19 pm

Re: PHP Warning for OCI8 - libclntsh.so.18.1 can not open

Post by lexisnexis »

I figured out the problem.

I had the old Oracle Instant Client in the /etc/ld.so.conf.d/ directory.

Steps to fix the issue:
  • Update /etc/ld.so.conf.d/oracle.conf with the new version
    Execute ldconfig as root
    Yum reinstall php-oci8
lexisnexis
Posts: 27
Joined: Wed Dec 30, 2015 3:19 pm

Re: PHP Warning for OCI8 - libclntsh.so.18.1 can not open

Post by lexisnexis »

This post can be closed.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: PHP Warning for OCI8 - libclntsh.so.18.1 can not open

Post by tgriep »

Thanks for letting us know that you fixed the issue and what you had to do to fix it.
It should be helpful to other users.
I'll close the post for you but feel free to open a new one in the future for and new questions or issues.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked