skip to Main Content

I have oracle instantclient 19.3 installed and can see that OCI8 is loaded in PHP from a terminal by running php -m. I also added LD_LIBRARY_PATH and ORACLE_HOME and environment variables to /etc/php-fpm.d/www.conf. They show up correctly in the environment section in phpinfo.

However, oci8 still does not show loading from apache.

Any suggestions on what else I can try to get this to work?

2

Answers


  1. Chosen as BEST ANSWER

    Miracle of miracles. Oracle has a specific instaclient for Linux 8. You can download it here. https://www.oracle.com/cis/database/technologies/instant-client/linux-x86-64-downloads.html

    Installing that driver took care of the problem. Wahoo ;)


  2. On Linux, LD_LIBRARY_PATH must be set before a process starts.

    On Oracle Linux 8 / RHEL 8 I found that I needed to edit /etc/php-fpm.d/www.conf and add:

    env[LD_LIBRARY_PATH] = /usr/lib/oracle/21/client64/lib:$LD_LIBRARY_PATH
    

    I had installed the Oracle Instant Client RPMs packages; change the path to suit your library location.

    I also disabled SELinux with setenforce permissive to avoid the error ORA-12546: TNS:permission denied. (Update: note the comment below about using audit2allow)

    When using Instant Client, you should not set ORACLE_HOME.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search