Forum Stats

  • 3,826,778 Users
  • 2,260,707 Discussions
  • 7,897,072 Comments

Discussions

php + oracle instant client, macOS Sierra

sly1986
sly1986 Member Posts: 3
edited Oct 12, 2016 9:16PM in PHP

Hello

Having some setup problems with php (any version) and oracle instant client on macOS Sierra and ElCapitan.

I've installed instant client, set necessary envvars: ORACLE_HOME,DYLD_LIBRARY_PATH. sqlplus works fine.

After that I've compiled php with oci8 support and its works fine if I'm running scripts directly using php interpreter.

But in some cases I'm getting error like this:

/usr/local/bin/php composer.phar testWarning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in /Users/www/Documents/PhpProjects/Oci8/src/Oci8/Oracle/DataObject.php on line 52PHP Warning:  oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in /Users/www/Documents/PhpProjects/Oci8/src/Oci8/Oracle/DataObject.php on line 52

Here is my phpinfo quotes:

phpinfo()PHP Version => 7.1.0RC3System => Darwin imc.local 16.0.0 Darwin Kernel Version 16.0.0: Mon Aug 29 17:56:20 PDT 2016; root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64Build Date => Oct  1 2016 17:42:43Configure Command =>  './configure'  '--enable-intl' '--with-oci8=shared,instantclient,/usr/local/oracle/instantclient_11_2' '--enable-opcache=no' '--enable-sigchild' '--enable-mbstring' '--with-xsl' '--with-gd' '--with-config-file-scan-dir=/etc/php' '--with-curl' '--with-openssl=/usr/local/Cellar/openssl/1.0.2h_1' '--with-zlib' '--enable-zip' '--enable-debug'Server API => Command Line InterfaceVirtual Directory Support => disabled...oci8OCI8 Support => enabledOCI8 DTrace Support => disabledOCI8 Version => 2.1.2Revision => $Id: 0527b558474b9602dac1cbae9d6544f6d1ee3f7e $Oracle Run-time Client Library Version => 11.2.0.4.0Oracle Compile-time Instant Client Version => 11.2Directive => Local Value => Master Valueoci8.connection_class => no value => no valueoci8.default_prefetch => 100 => 100oci8.events => Off => Offoci8.max_persistent => -1 => -1oci8.old_oci_close_semantics => Off => Offoci8.persistent_timeout => -1 => -1oci8.ping_interval => 60 => 60oci8.privileged_connect => Off => Offoci8.statement_cache_size => 20 => 20...

Anyone can say how to correctly setup php with oci8 support on macOS Sierra/El Capitan and avoid this errors?

Answers

This discussion has been closed.