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
Now, since the error talks about environment varibles, I've set these prior to running the script. If I do
export ORACLE_HOME=/ora01/app/oracle/product/10.2.0/db_1
Then the script will run and connect to the DB, but only if I run the script from the command line. I've tried several ways to set the environment variables within Apache itself or within PHP, but they just won't work. Even when PHP tells me that the environment variables are set correctly, it still won't work on the web. I've tried doing the export prior to starting up apache. I've also modified the apachectl script to set the environment variables. I've also modified the envvars file. And last, I tried modifying it through apache within the httpd.conf
- Code: Select all
SetEnv ORACLE_HOME /ora01/app/oracle/product/10.2.0/db_1
SetEnv LD_LIBRARY_PATH /ora01/app/oracle/product/10.2.0/db_1/lib
PassEnv LD_LIBRARY_PATH
PassEnv ORACLE_HOME
but with no luck. On The Underground PHP and Oracle Manual from Oracle, it states
which is what I'm thinking the problem is, because I can make it work on the command line but not on the web. Any help will be greatly appreciated....The important thing is to set the environment before
Apache loads any Oracle library...