php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36545 OCIEnvNlsCreate() failed
Submitted: 2006-02-27 18:19 UTC Modified: 2006-02-28 17:06 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jistanidiot at gmail dot com Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.1.2 OS: RHEL4
Private report: No CVE-ID: None
 [2006-02-27 18:19 UTC] jistanidiot at gmail dot com
Description:
------------
When any oci_connect is called an error message about OCIEnvNlSCreate() failing is produced.

Workaround: add the apache user to the oracle group.  This only occurs in 5.2.1.  Previous versions of PHP which I've tried (5.0.3 and 5.1.0) did not have this problem.  Obviously this is a security issue as the apache user now has a lot more things it can use to wreak havoc.

Oracle version 10.2.0.1.0.  Apache version 2.0.52.
OS: Red Hat Enterprise Linux ES 4.



Reproduce code:
---------------
  $conn = oci_connect('user', 'pass', 'db');
  if (!$conn) {
   $e = oci_error();
   print htmlentities($e['message']);
   exit;
  }


Expected result:
----------------
Expect to actually connect to the database

Actual result:
--------------
[error] PHP Warning:  oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in <scriptname> on line <linenum>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-27 23:56 UTC] cjbj at hotmail dot com
Can you verify that the same version of Oracle was used in yours tests with PHP 5.0.3 and 5.1.x?  Oracle 10.2 defaults to a stricter set of directory permissions than previous versions of Oracle.  The only time I've seen this problem has been when the version of Oracle changed.
 [2006-02-28 10:30 UTC] tony2001@php.net
Oracle libraries have certain requirements and this is not  PHP or OCI8 issue.
 [2006-02-28 15:35 UTC] jistanidiot at gmail dot com
The 5.0.x was probably with Oracle 9i.  All of the 5.1.x have been with Oracle 10g.  

I strongly object to this being labled as bogus.  This is not an Oracle issue as Oracle works just fine.  This is clearly a PHP issue as PHP does not work fine.  PHP needs to meet the requirements of Oracle if it is going to use Oracle. Until it can meet the requirements PHP has a bug.
 [2006-02-28 17:06 UTC] tony2001@php.net
If Oracle libraries are unable to get required data because of the filesystem restrictions and fails to initialize, the only thing PHP can do is to fail with an error message, which is the case.
And no, *PHP* itself cannot meet any requirements set by Oracle libraries, *you* should care about it. PHP only uses these libraries and they do not work - sorry, ext/magic isn't implemented yet.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 20:01:30 2024 UTC