php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37774 OCIEnvNlsCreate() failed, ordering of env setup
Submitted: 2006-06-10 21:34 UTC Modified: 2006-06-12 10:46 UTC
From: e2kabugs at troof dot org Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.1.4 OS: Scientific Linux CERN 3 (RHEL 3)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: e2kabugs at troof dot org
New email:
PHP Version: OS:

 

 [2006-06-10 21:34 UTC] e2kabugs at troof dot org
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"



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-12 10:46 UTC] tony2001@php.net
SetEnv obviously won't work and it never did.
You need to change your *environment*, not Apache .conf files. Use export/putenv/set etc.
Not PHP problem.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC