Page 2 of 2

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

Posted: Fri May 03, 2019 4:07 pm
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

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

Posted: Mon May 06, 2019 8:04 am
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

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

Posted: Mon May 06, 2019 9:35 am
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

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

Posted: Mon May 06, 2019 10:00 am
by lexisnexis
This post can be closed.

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

Posted: Mon May 06, 2019 2:08 pm
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.