Search code examples
phpphp-7opensuseoci8

Install OCI8 with PHP-FPM on OpenSUSE


I am trying to install OCI8 with PHP-FPM 7 on OpenSUSE 42.3, but the extension is not loading.

  • I installed oracle-instantclient12.2-basic and oracle-instantclient12.2-devel with RPM.
  • I installed oci8 php extension with pecl.
  • I added extension to php.ini.
  • I restarted the apache and php-fpm services.

In the log, there is the next error:

NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php7/extensions/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0

Also, I tried different solutions, but nothing works:

Option 1: I added the next lines to the file /etc/sysconfic/apache2 and I restarted services:

export LD_LIBRARY_PATH="/usr/lib/oracle/12.2/client64/lib"
export ORACLE_HOME="/usr/lib/oracle/12.2/client64"

Option 2: I added the next lines to the file /etc/php7/fpm/php-fpm.d/www.conf and I restarted services:

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

Option 3: I add the next line to the file /etc/ld.so.conf.d/oracle.conf, I ran ldconfig and I restarted services:

/usr/lib/oracle/12.2/client64/lib/

Can anybody help me?

Thanks you!


Solution

  • For install OCI8 with PHP-FPM 7 on OpenSUSE 42.3, we must do next steps:

    • Install oracle-instantclient12.2-basic and oracle-instantclient12.2-devel with RPM.
    • Install oci8 php extension with pecl.
    • Add extension to php.ini.
    • Add the next line to the file /etc/ld.so.conf.d/oracle.conf and run ldconfig

      /usr/lib/oracle/12.2/client64/lib/

    • Restart the apache and php-fpm services.