• PHP can't find shared library although it's right there

    From Robert Latest@21:1/5 to All on Tue May 25 14:55:47 2021
    Hello,

    I'm trying to install the oracle DB extension on this RHEL7 system but I can't get it to work. The server says on startup:

    $ grep oci /var/log/httpd/error_log PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory)) in Unknown on line 0

    But the file is right there:

    $ ls -l /usr/lib64/php/modules/oci8.so
    -rwxr-xr-x. 1 root root 185832 May 4 14:13 /usr/lib64/php/modules/oci8.so

    phpinfo.php lists the OCI8 modules with their authors. What am I missing?

    --
    robert

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John-Paul Stewart@21:1/5 to Robert Latest on Tue May 25 11:50:51 2021
    On 2021-05-25 10:55 a.m., Robert Latest wrote:
    Hello,

    I'm trying to install the oracle DB extension on this RHEL7 system but I can't
    get it to work. The server says on startup:

    $ grep oci /var/log/httpd/error_log PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory)) in Unknown on line 0

    But the file is right there:

    $ ls -l /usr/lib64/php/modules/oci8.so
    -rwxr-xr-x. 1 root root 185832 May 4 14:13 /usr/lib64/php/modules/oci8.so

    First off, I'm not familiar with the oci8 module itself, so the
    following may not be entirely accurate:

    The error message seems to be showing that it is trying to load /usr/lib64/php/modules/oci8 and not finding it. Which is to be
    expected. Then it tries /usr/lib64/php/modules/oci8.so which it does
    find but cannot open because its dependency, libclntsh.so.21.1, is not
    found. What does 'ldd /usr/lib64/php/modules/oci8.so' show?

    Do you have libclntsh.so.21.1 installed somewhere on your system? If
    not you'll need to install it. If it is installed, then you'll need to
    set the library path to point to it, so that it can be found when needed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to boblatest@yahoo.com on Tue May 25 10:47:50 2021
    At 25 May 2021 14:55:47 GMT Robert Latest <boblatest@yahoo.com> wrote:


    Hello,

    I'm trying to install the oracle DB extension on this RHEL7 system but I can't
    get it to work. The server says on startup:

    $ grep oci /var/log/httpd/error_log PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory)) in Unknown on line 0

    But the file is right there:

    $ ls -l /usr/lib64/php/modules/oci8.so
    -rwxr-xr-x. 1 root root 185832 May 4 14:13 /usr/lib64/php/modules/oci8.so

    phpinfo.php lists the OCI8 modules with their authors. What am I missing?

    libclntsh.so.21.1 shared library file is missing. The OCI8 module needs the libclntsh.so.21.1 shared library to also be installed. Yes the error message is a little confusing.



    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    heller@deepsoft.com -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arno Welzel@21:1/5 to All on Tue May 25 18:22:42 2021
    Robert Latest:

    Hello,

    I'm trying to install the oracle DB extension on this RHEL7 system but I can't
    get it to work. The server says on startup:

    $ grep oci /var/log/httpd/error_log PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory)) in Unknown on line 0

    But the file is right there:

    $ ls -l /usr/lib64/php/modules/oci8.so
    -rwxr-xr-x. 1 root root 185832 May 4 14:13 /usr/lib64/php/modules/oci8.so

    No - the missing library is "libclntsh.so.21.1" not oci8.so.

    phpinfo.php lists the OCI8 modules with their authors. What am I missing?

    You miss libclntsh.so.21.1, not oci8.so.

    Also see: <https://docs.oracle.com/en/database/oracle/oracle-database/21/lacli/instant-client-shared-libraries.html>


    --
    Arno Welzel
    https://arnowelzel.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to jpstewart@personalprojects.net on Tue May 25 11:24:05 2021
    At Tue, 25 May 2021 11:50:51 -0400 John-Paul Stewart <jpstewart@personalprojects.net> wrote:


    On 2021-05-25 10:55 a.m., Robert Latest wrote:
    Hello,

    I'm trying to install the oracle DB extension on this RHEL7 system but I can't
    get it to work. The server says on startup:

    $ grep oci /var/log/httpd/error_log PHP Warning: PHP Startup: Unable to load
    dynamic library 'oci8' (tried: /usr/lib64/php/modules/oci8 (/usr/lib64/php/modules/oci8: cannot open shared object file: No such file or
    directory), /usr/lib64/php/modules/oci8.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory)) in Unknown on line 0

    But the file is right there:

    $ ls -l /usr/lib64/php/modules/oci8.so
    -rwxr-xr-x. 1 root root 185832 May 4 14:13 /usr/lib64/php/modules/oci8.so

    First off, I'm not familiar with the oci8 module itself, so the
    following may not be entirely accurate:

    The error message seems to be showing that it is trying to load /usr/lib64/php/modules/oci8 and not finding it. Which is to be
    expected. Then it tries /usr/lib64/php/modules/oci8.so which it does
    find but cannot open because its dependency, libclntsh.so.21.1, is not
    found. What does 'ldd /usr/lib64/php/modules/oci8.so' show?

    Do you have libclntsh.so.21.1 installed somewhere on your system? If
    not you'll need to install it. If it is installed, then you'll need to
    set the library path to point to it, so that it can be found when needed.

    If it is installed in a "standard place", ldconfig will take care of it.




    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    heller@deepsoft.com -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John-Paul Stewart@21:1/5 to Robert Heller on Tue May 25 13:40:54 2021
    On 2021-05-25 12:24 p.m., Robert Heller wrote:
    At Tue, 25 May 2021 11:50:51 -0400 John-Paul Stewart <jpstewart@personalprojects.net> wrote:

    Do you have libclntsh.so.21.1 installed somewhere on your system? If
    not you'll need to install it. If it is installed, then you'll need to
    set the library path to point to it, so that it can be found when needed.

    If it is installed in a "standard place", ldconfig will take care of it.

    The error showed that either it was not installed at all or it was not
    in a "standard place".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Latest@21:1/5 to Arno Welzel on Tue May 25 17:18:45 2021
    Arno Welzel wrote:

    No - the missing library is "libclntsh.so.21.1" not oci8.so.

    phpinfo.php lists the OCI8 modules with their authors. What am I missing?

    You miss libclntsh.so.21.1, not oci8.so.

    Thanks to you and all the other guys. Found and installed the appropriate rpm from Oracle, fixed the conf file in /etc/ld.conf.d/, ran ldconfig, restarted Apache, and voila.

    --
    robert

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)