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.
lexisnexis
Posts: 27
Joined: Wed Dec 30, 2015 3:19 pm

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

Post by lexisnexis »

Nagios XI: 5.5.2

A few weeks ago, the Linux server were patched and the OCI8 library is requiring libclntsh.so.18.1. I have upgraded the oracle-instant-client to 18.5 on the Linux server. Why is this message still showing up in Nagios XI?
Capture.PNG
[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]

Code: Select all

 set | grep -i oracle
LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib
ORACLE_HOME=/usr/lib/oracle/18.5/client64
TNS_ADMIN=/usr/lib/oracle/18.5/client64

Code: Select all

locate libclntsh.so.18.1
/usr/lib/oracle/18.5/client64/lib/libclntsh.so.18.1

Code: Select all

php -i | grep -i oci
/etc/php.d/20-oci8.ini,
/etc/php.d/30-pdo_oci.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => enabled
OCI8 Version => 2.0.12
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
PDO drivers => dblib, mysql, oci, pgsql, sqlite
PDO_OCI
PDO Driver for OCI 8 and later => enabled
You do not have the required permissions to view the files attached to this post.
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 forgot to add some information. The RPM used to install the upgrade of oracle-instantclient18.5: oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm

Code: Select all

Oracle instantclient on the server:
/usr/lib/oracle/12.1/client64
/usr/lib/oracle/18.5/client64/
[code]

[code]
grep error_report /etc/php.ini 
; error_reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING
; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().

Code: Select all

cat /etc/sysconfig/httpd 
#
# This file can be used to set additional environment variables for
# the httpd process, or pass additional options to the httpd
# executable.
#
# Note: With previous versions of httpd, the MPM could be changed by
# editing an "HTTPD" variable here.  With the current version, that
# variable is now ignored.  The MPM is a loadable module, and the
# choice of MPM can be changed by editing the configuration file
# /etc/httpd/conf.modules.d/00-mpm.conf.
# 

#
# To pass additional options (for instance, -D definitions) to the
# httpd binary at startup, set OPTIONS here.
#
#OPTIONS=

#
# This setting ensures the httpd process is started in the "C" locale
# by default.  (Some modules will not behave correctly if
# case-sensitive string comparisons are performed in a different
# locale.)
#
LANG=C
#LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
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 »

Did you install all 3 of the Oracle Instant Client packages?

Code: Select all

oracle-instantclient18.5-basic-18.5.0.0.0-3.x86_64.rpm
oracle-instantclient18.5-sqlplus-18.5.0.0.0-3.x86_64.rpm
oracle-instantclient18.5-devel-18.5.0.0.0-3.x86_64.rpm
What version of PHP is installed on the server and what repository did it come from?

Run the following and post it here.

Code: Select all

php -v
yum list installed |grep -i php
Did you upgrade the path for the commands in XI?

Code: Select all

/usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib ORACLE_HOME=/usr/lib/oracle/18.5/client64 $USER1$/check_oracle_health $ARG1$
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 »

Did you install all 3 of the Oracle Instant Client packages? No only installed Basic

What version of PHP is installed on the server and what repository did it come from?

Code: Select all

php -v
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

yum list installed |grep -i php
php.x86_64                    5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-ZendFramework.noarch      1.12.20-1.el7.remi              @Frozen-LN-remi   
php-ZendFramework-Db-Adapter-Pdo.noarch
php-ZendFramework-Db-Adapter-Pdo-Oci.noarch
php-bcmath.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-cli.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-common.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-devel.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-fedora-autoloader.noarch  1.0.0-1.el7.remi                @Frozen-LN-remi   
php-gd.x86_64                 5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-ldap.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mbstring.x86_64           5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mcrypt.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mssql.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mysqlnd.x86_64            5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-oci8.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-pdo.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-pear.noarch               1:1.10.7-4.el7.remi             @DevFrozen-LN-remi
php-pear-HTML-Template-IT.noarch
php-pecl-crypto.x86_64        0.3.1-1.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-igbinary.x86_64      2.0.8-1.el7.remi.5.6            @DevFrozen-LN-remi-php56
php-pecl-jsonc.x86_64         1.3.10-2.el7.remi.5.6           @Frozen-LN-remi-php56
php-pecl-jsonc-devel.x86_64   1.3.10-2.el7.remi.5.6           @Frozen-LN-remi-php56
php-pecl-memcached.x86_64     2.2.0-3.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-msgpack.x86_64       0.5.7-1.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-ssh2.x86_64          0.13-3.el7.remi.5.6             @Frozen-LN-remi-php56
php-pecl-zip.x86_64           1.15.4-1.el7.remi.5.6           @DevFrozen-LN-remi-php56
php-pgsql.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-process.x86_64            5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-snmp.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-soap.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-xml.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php73.x86_64                  1.0-0.1.el7.remi                @DevFrozen-LN-remi
php73-php-cli.x86_64          7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-common.x86_64       7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-json.x86_64         7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-soap.x86_64         7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-runtime.x86_64          1.0-0.1.el7.remi                @DevFrozen-LN-remi
Did you upgrade the path for the commands in XI?
No, but I will update them.
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 »

Install all 3 of the RPM files in the server. I think they are required for the plugin.
Update the command and let us know if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 »

Will check into this and get back to you.
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 »

OK, Let us know how it works out.
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 was able to install the 3 packages and restarted the httpd service, but I am still getting the PHP Warning messages. I updated the ORACLE commands in Nagios.

Any other suggestions?

sudo yum list | grep oracle
nagios-plugins-oracle.x86_64 2.2.1-16.20180725git3429dad.el7
oracle-instantclient18.5-basic.x86_64 18.5.0.0.0-3 installed
oracle-instantclient18.5-devel.x86_64 18.5.0.0.0-3 installed
oracle-instantclient18.5-sqlplus.x86_64
golang-googlecode-tools-oracle.x86_64 0-1.0.hgd32b5854c941.el7
kmod-oracleasm.x86_64 2.0.8-22.1.el7_6 Frozen-LN-updates
mono-data-oracle.x86_64 4.6.2-4.el7 Frozen-LN-epel
pcp-pmda-oracle.x86_64 4.1.0-5.el7_6 Frozen-LN-updates
tuned-profiles-oracle.noarch 2.10.0-6.el7_6.3 Frozen-LN-updates
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 »

The problem is that you have two different versions of PHP installed, you'll need to fix that:

Code: Select all

php.x86_64                    5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-ZendFramework.noarch      1.12.20-1.el7.remi              @Frozen-LN-remi   
php-ZendFramework-Db-Adapter-Pdo.noarch
php-ZendFramework-Db-Adapter-Pdo-Oci.noarch
php-bcmath.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-cli.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-common.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-devel.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-fedora-autoloader.noarch  1.0.0-1.el7.remi                @Frozen-LN-remi   
php-gd.x86_64                 5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-ldap.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mbstring.x86_64           5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mcrypt.x86_64             5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mssql.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-mysqlnd.x86_64            5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-oci8.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-pdo.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-pear.noarch               1:1.10.7-4.el7.remi             @DevFrozen-LN-remi
php-pear-HTML-Template-IT.noarch
php-pecl-crypto.x86_64        0.3.1-1.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-igbinary.x86_64      2.0.8-1.el7.remi.5.6            @DevFrozen-LN-remi-php56
php-pecl-jsonc.x86_64         1.3.10-2.el7.remi.5.6           @Frozen-LN-remi-php56
php-pecl-jsonc-devel.x86_64   1.3.10-2.el7.remi.5.6           @Frozen-LN-remi-php56
php-pecl-memcached.x86_64     2.2.0-3.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-msgpack.x86_64       0.5.7-1.el7.remi.5.6            @Frozen-LN-remi-php56
php-pecl-ssh2.x86_64          0.13-3.el7.remi.5.6             @Frozen-LN-remi-php56
php-pecl-zip.x86_64           1.15.4-1.el7.remi.5.6           @DevFrozen-LN-remi-php56
php-pgsql.x86_64              5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-process.x86_64            5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-snmp.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-soap.x86_64               5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56
php-xml.x86_64                5.6.40-1.el7.remi               @DevFrozen-LN-remi-php56

Code: Select all

php73.x86_64                  1.0-0.1.el7.remi                @DevFrozen-LN-remi
php73-php-cli.x86_64          7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-common.x86_64       7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-json.x86_64         7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-php-soap.x86_64         7.3.1-1.el7.remi                @DevFrozen-LN-remi
php73-runtime.x86_64          1.0-0.1.el7.remi                @DevFrozen-LN-remi
Please post the full output of these commands (run them as root):

Code: Select all

php -V
su - nagios
php -V
Please PM me a copy of your profile if you're able to generate it, you can download it from Admin > System Profile > Download Profile.

If you're unable to generate the the profile through the web interface, please try generating it from the command line by running these commands as root:

Code: Select all

rm -rf /usr/local/nagiosxi/var/components/profile.zip​
/usr/local/nagiosxi/scripts/components/getprofile.sh​ SUPPORT​
Then send me the resulting /usr/local/nagiosxi/var/components/profile.zip​ file.​

If the profile script fails, please include the ENTIRE output.
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 sent the profile.zip via the PM you requested.

I have 2 version of PHP, because I have monitor check which require PHP 7.

Not sure if you wanted the -V to be lowercase to get the version.

Code: Select all

[root@XX ~]# php -v
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

[nagios@XX ~]$ sudo su - nagios
Last login: Fri May  3 16:10:05 EDT 2019 on pts/0

[nagios@XX ~]$ php -v
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
Locked