title: Oracle 11g PHP oci_connect fails OCIEnvNlsCreate()
body: <p>Problem: Linux CentOS/Oracle 11g/InstantClient/PHP 5.3.3</p>
  
  <p>Error: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories</p>
  
  <p>phpinfo() relevant sections:</p>
  
  <p><img src="https://i.stack.imgur.com/ZTZyX.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Y6olm.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/J4iuI.png" alt="enter image description here"></p>
  
  <p>As you see, the environment variables are correctly set, and I can echo them on the page with with <code>getenv()</code>.  I also checked the read permissions and I can read all the files in these directories from the webpage. The client library files are there (I installed and reinstalled twice) full install.  The libraries are readable and loadable.</p>
  
  <p>ldd did not show any errors.</p>
  
  <p>Here is the call from php file:</p>
  
  <pre><code>$test = getenv('LD_LIBRARY_PATH')."  ".getenv('ORACLE_HOME');
  $this-&gt;dbconn = oci_connect("myuser","mypassword", "localhost/orcl") or die("&lt;b&gt;Connection Failed: $test &lt;/b&gt;").oci_error();
  </code></pre>
  
  <p>I tried all the tricks I found from googling, nothing worked.<br>
  Any help is appreciated.</p>