Search code examples
phpoci8debian-jessieinstantclient

PHP not recognizing where oci8.so was installed


I'm attempting to install oci8 with PHP 7.1. I am following the instructions here: http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html

I have:

  • debian 8.8
  • php 7.1
  • instant client installed in /opt/instantclient_12_2
  • pecl install oci8 installs correctly with the following ending the installation process (using instantclient,/opt/instantclient_12_2):

    Build process completed successfully
    Installing '/usr/lib/php/20151012/oci8.so'
    install ok: channel://pecl.php.net/oci8-2.1.4
    configuration option "php_ini" is not set to php.ini location
    You should add "extension=oci8.so" to php.ini
    

I have enabled the extension in php.ini too. When I try to do a php -i I get the following:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/oci8.so' - /usr/lib/php/20160303/oci8.so: cannot open shared object file: No such file or directory in Unknown on line 0

The oci8.so is in 20151012 not 20160303. I've tried symlinks and just moving it over but it detects it's not compiled for that format and doesn't like that either.

What am I missing? How do I get this all to play nicely?

I have made the same changes between cli and apache php.ini files.

Thanks in advance.


Solution

  • PHP OCI8 on PECL supports PHP 7 (and older versions - see the PECL page for installing on older PHP versions).

    Try uninstalling OCI8.

    Check you don't have multiple version of PHP - the path name difference makes me think you do.