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
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.
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, ...
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.