Edit report at https://bugs.php.net/bug.php?id=58925&edit=1
ID: 58925 Updated by: s...@php.net Reported by: glenn dot schmidt at deakin dot edu dot au Summary: No error information available when php_oci_create_env fails Status: Open Type: Bug -Package: oci8 +Package: *General Issues Operating System: Any PHP Version: Irrelevant Assigned To: sixd Block user comment: N Private report: N New Comment: It's a pity there is no useful information in this bug about the versions and environments this is seen on. The root problem could be anywhere (including webserver memory corruption). However since the failure is coming from the environment setup, it's worth triple-checking the OCI8 environment is set correctly. Make sure scripts don't use setenv() to set Oracle environment variables. Previous Comments: ------------------------------------------------------------------------ [2011-11-07 11:13:58] areddan at silverarm dot com Does anyone have a solution / update to this one ? I', experiencing similar issues on a clients site, and again its not repeatable. ------------------------------------------------------------------------ [2010-09-08 18:57:56] russ at iris dot washington dot edu I am seeing this error now for the last few months. Very frustrating because no way to force it to happen. As far as I know I changed nothing at all. There must be some resource limit either in PHP or Oracle that is not being reported back as being exceeded. The Apache logs (access and error) contain nothing. ------------------------------------------------------------------------ [2009-11-04 20:52:22] glenn dot schmidt at deakin dot edu dot au To force an OCIEnvNlsCreate failure you can always move or otherwise make inaccessible some of the instant client library files. But the particular issue I am seeing on our production web server (running Red Hat EL 5) involves OCIEnvNlsCreate failing intermittently, and unfortunately we can't reliably reproduce it. All we know is, when it starts to happen, it seems to globally affect all web applications on the host for a few minutes (none of them can connect), then it goes away again. I'm not saying that the oci8 extension is responsible for the problem we're seeing, but the fact that the error condition can't be trapped and identified by the PHP script (with oci_error()) is making it harder to track the problem and identify how frequently it's happening. A lot of applications (including Zend_Db) will suppress oci_connect() warnings with @ and then only log the output of oci_error(). ------------------------------------------------------------------------ [2009-11-04 19:49:51] christopher dot jones at oracle dot com What was your testcase? ------------------------------------------------------------------------ [2009-10-29 00:12:53] glenn dot schmidt at deakin dot edu dot au Description: ------------ I don't think that the function php_oci_create_env handles failure of OCIEnvNlsCreate as well as it should. It will always just output the "There is something wrong with your system" message, as a PHP warning. It doesn't attempt to get an actual error message from OCIErrorGet(). It also doesn't store the error in such a way that it is accessible to the PHP oci_error() function. Reproduce code: --------------- $conn = oci_connect('scott', 'tiger', 'mydb'); if (!$conn) { $e = oci_error(); if ($e) { echo 'The error that occurred was: "'.$e['message'].'"'; } } Expected result: ---------------- (if OCIEnvNlsCreate was to fail) **Warning: 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 The error that occurred was: "<message from OCIErrorGet, or at least the same message as in the above warning>" Actual result: -------------- **Warning: 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 **Warning: oci_error(): OCIError: unable to find error handle ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=58925&edit=1