Edit report at http://bugs.php.net/bug.php?id=50511&edit=1
ID: 50511
Comment by: volker dot senkel at f-i dot de
Reported by: kma at sam dot sdu dot dk
Summary: Warning: oci_connect() [function.oci-connect]:
OCIEnvNlsCreate() failed
Status: Bogus
Type: Bug
Package: OCI8 related
Operating System: RHEL 4
PHP Version: 5.3.1
Assigned To: sixd
Block user comment: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2009-12-18 16:37:33] [email protected]
-------------
Please ask pursue a solution using a Support forum such as
http://forums.oracle.com/forums/forum.jspa?forumID=178
http://www.php.net/mailing-lists.php
Also see:
http://wiki.oracle.com/page/PHP+Oracle+FAQ
http://us.php.net/manual/en/oci8.installation.php
------------------------------------------------------------------------
[2009-12-18 06:59:52] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=50511&edit=1