From: e2kabugs at troof dot org Operating system: Scientific Linux CERN 3 (RHEL 3) PHP version: 5.1.4 PHP Bug Type: OCI8 related Bug description: OCIEnvNlsCreate() failed, ordering of env setup
Description: ------------ After compiling/installing PHP for Apache2 --with- oci8=instantclient,/usr/lib/oracle with /usr/lib/oracle directory containing the Oracle Instant Client libraries with the correct permissions, and having an apache conf file in /etc/httpd/conf.d/php.conf with the following directives: LoadModule php5_module modules/libphp5.so SetEnv LD_LIBRARY_PATH /usr/lib/oracle Calls to oci_connect() will result in the following misleading error: Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that LD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries in [file] on line [line] Inspecting phpinfo() "Environment" and "PHP Variables" sections will show that your LD_LIBRARY_PATH is correctly set. The workaround is to change the order of your directives: SetEnv LD_LIBRARY_PATH /usr/lib/oracle LoadModule php5_module modules/libphp5.so and oci_connect will work properly. Expected result: ---------------- If LD_LIBRARY_PATH needs to be set before loading the module (which appears to be the case), an error should be written to the error log before any user code tries to use oci8. The error message should be something like the following: "libphp5.so cannot be loaded. Missing or incorrect LD_LIBRARY_PATH needed for the oci8 Oracle Instant Client libraries" -- Edit bug report at http://bugs.php.net/?id=37774&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37774&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37774&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37774&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37774&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37774&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37774&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37774&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37774&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37774&r=support Expected behavior: http://bugs.php.net/fix.php?id=37774&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37774&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37774&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37774&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37774&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37774&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37774&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37774&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37774&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37774&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37774&r=mysqlcfg