php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50511 Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed
Submitted: 2009-12-18 06:59 UTC Modified: 2009-12-18 16:37 UTC
From: kma at sam dot sdu dot dk Assigned: sixd (profile)
Status: Not a bug Package: OCI8 related
PHP Version: 5.3.1 OS: RHEL 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kma at sam dot sdu dot dk
New email:
PHP Version: OS:

 

 [2009-12-18 06:59 UTC] kma at sam dot sdu dot dk
Description:
------------
Hi!

I'm having seriuos issues with this error, i tried almost anything now but i still have this error:

Warning: oci_connect() http://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 /web/SITE/www/lic/db/db.php on line 19
Connection to Oracle Server lost!
This could be due to a known problem with the Apache webserver. Please restart Apache and you should be ok.

This error occured after upgrading from PHP 5.0.4 to 5.3.1 (also tried 5.2.11 with same error)

I have configured my PHP with:
./configure --with-apxs2=/opt/httpd/bin/apxs --with-mysql --prefix=/opt/php --enable-mbstring=all --with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client --with-zlib

My LD_LIBRARY_PATH is set via export LD_LIBRARY_PATH to:
LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib

I also tried different thing like configure it with shared instead of instantclient. etc.
Also i tried to download InstantClient 11.2 and install it throug RPMs, i can see that PHP configures with the client and my PHPINFO looks like this (the wierd is that it also says version 10.2 when i use 11.2 client )

OCI8 Support enabled
Version 1.3.5
Revision $Revision: 289423 $
Active Persistent Connections 0
Active Connections 0
Oracle Instant Client Version 10.2
Temporary Lob support enabled
Collections support enabled

Directive Local Value Master Value
oci8.connection_class no value no value
oci8.default_prefetch 100 100
oci8.events Off Off
oci8.max_persistent -1 -1
oci8.old_oci_close_semantics Off Off
oci8.persistent_timeout -1 -1
oci8.ping_interval 60 60
oci8.privileged_connect Off Off
oci8.statement_cache_size 20 20


I've bin struggling with this for 2 days now, and i'm so tired so i can't remember everything i tried, but ask me..

Thanks soo much in advance!!

Reproduce code:
---------------
./configure --with-apxs2=/opt/httpd/bin/apxs --with-mysql --prefix=/opt/php --enable-mbstring=all --with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client --with-zlib

Expected result:
----------------
Connection success!

Actual result:
--------------
Warning: oci_connect() [function.oci-connect]: OCIEnvNlsCreate() failed

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-20 16:55 UTC] volker dot senkel at f-i dot de
Hi,

I think we had the same problem. After long time poking into fog, we found out that patching the file:

	php5/ext/oci8/oci8.c

with (line 1035):

  /*errstatus = OCIEnvNlsCreate(&OCI_G(env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL, 0, 0);*/
  errstatus = OCIEnvCreate(&OCI_G(env), PHP_OCI_INIT_MODE, 0, NULL, NULL, NULL, 0, NULL);

seams to be a workaround for that problem.
 We have 2 php scripts that insert data into our oracle database. One script always fails and the other script sometimes. Both script use the same underlying class to connect to the database and both scripts call oci_connect with the same parameter.
Adding debug code to the oci8.c file, we found that the call of OCIEnvNlsCreate sometimes failed without an comprehensible reason and the parameter of OCIEnvNlsCreate are not very complicate.
Comparing the oci8.c file from php 5.3 with that of php 5.2 we decided to change the function call. With that patch both php scripts seamed to work. I think, this is not a fix, but a workaround.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 04:01:30 2024 UTC