Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 545 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 440 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
php + oracle instant client, macOS Sierra
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
-
The SIP changes in recent OS X releases cause problems passing environment variables like DYLD_LIBRARY_PATH to subshells. There were some relevant changes in the 12.1 Instant Client on OS X to resolve this kind of linking issue. Try upgrading from Instant Client downloads for Mac OS X (Intel x86). Alternatively, try rputting the Instant Client 11 libraries in ~/lib (see https://github.com/oracle/node-oracledb/issues/149#issuecomment-170711705)