0

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.

Ryan Price
  • 315
  • 6
  • 17
  • It may be that `oci8` pecl extension does not yet support PHP 7.1 (PHP 7.1 has different extension bindings than PHP 7.0, so a version specially compiled for PHP 7.1 would be needed). Could you try the extension with PHP 7.0? – Jirka Hrazdil Jul 10 '17 at 19:00

1 Answers1

1

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.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
  • 1
    Thank you Chris - your hunch was correct. I had multiple versions of PHP installed. For anyone else that finds this in the future, I needed to install php-dev so that it included phpize, which is needed to install oci8. – Ryan Price Jul 11 '17 at 13:44
  • So, instead installing php7.0 I should install only php7.0-dev (not php-cli etc)? I'm having same issue – Enrique Jul 20 '17 at 12:22