1 2 Previous Next 18 Replies Latest reply on Jun 11, 2010 9:24 PM by cj Go to original post
      • 15. Re: OCIEnvNlsCreate() failed
        777951
        Hey, I hate to bring up an old topic, but I'm having this same problem.

        Warning: oci_connect() [function.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 in /htpub/ontology/databasetest.php on line 7

        Looking through my PHPInfo() I find that these variables are set

        SERVER["ORACLEHOME"]      /oracle01/oracle/product/10.2.0
        _SERVER["LD_LIBRARY_PATH"]      /usr/lib:/usr/local/lib
        _ENV["LD_LIBRARY_PATH"] /usr/local/httpd-2.2.14/lib:/usr/local/openldap-2.3.39/lib:/usr/sfw/lib:/usr/local/BerkeleyDB.4.3/lib

        Do I need an _ENV["ORACLE_HOME"] variable set as well or am I having another problem? I really need to connect to the oracle databases here for an applet that my supervisor wants me to create.

        Thanks in advance, sorry for the revival of this old topic, but considering it is the same error I felt like it'd be better to bring up an old one rather than start a brand new one. If mods feel I did wrong, please let me know.
        • 16. Re: OCIEnvNlsCreate() failed
          cj
          Yes, it is the same error and probably has the same cause: environment variables are not set before starting the webserver. I'd expect to see LD_LIBRARY_PATH contain some Oracle libraries.

          However this is just a guess. Can you tell us what platform you are on, what Oracle components you have installed, what architecture you want (i.e. where is the DB you want to connect to, are you using FastCGI or an Apache mod), what version of PHP is installed, what webserver you are using, whether any of the hints in the PHP Oracle FAQ or Underground PHP & Oracle Manual help, what you have tried, ...
          • 17. Re: OCIEnvNlsCreate() failed
            777951
            I'm trying to connect to an Oracle 10g database here and it's Apache with PHP Version 5.3.1. I think it is an environment variable thing and I've notified the Server Admin, but I just wanted to see if there might be other possibilities I should have informed him about as well.

            Edit: Ah pretty sure it is a variable problem. Do I have to have the server admin edit the variables or can I do it within a PHP script itself? Basically the LD_LIBRARY_PATH is pointing to the wrong place and there's no ENV["ORACLEHOME"] variable.

            Edited by: user13272826 on Jun 9, 2010 6:18 AM
            • 18. Re: OCIEnvNlsCreate() failed
              cj
              Environment variable should be set before PHP starts - see the Oracle PHP FAQ or the Underground PHP & Oracle Manual.
              1 2 Previous Next