Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with env vars (ORACLE_HOME and LD_LIBRARY_PATH) in Linux server

943072Jun 12 2012 — edited Feb 21 2013
Hello all.

Let me introduce my problem with Oracle connection.


I currently have a Red Hat Enterprise Linux Server release 5.5.
This server is running php and will connect to a Unix server where Oracle DB is located.

After a lot of effort, including even altering selinux configuration, I achieved installing Oci8 extension in php (version 5.1.6) in Redhat server, but when executing a simple php test (including just oci_connect function), I get the following error:

"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 /var/www/html/testoracle.php on line 6
not connected"




I have checked the values of ORACLE_HOME and LD_LIBRARY_PATH with a script containing phpinfo() function, and I confirmed that their values are correctly set in:
Apache Environment, oci8, Environment and PHP Variables tables.

Their values are /opt/oracle/oraclehome and /opt/oracle/oraclehome/lib respectively.
/opt/oracle/oraclehome is the folder where I had Oracle Client 10.2 installed.

I have also checked the oracle.conf file in /etc/ld.so.conf/ folder, and it point to /opt/oracle/oraclehome/lib too.

I have added user 'apache' to group 'oracle'.

I had Apache restarted, even the server restarted, but even now I keep getting the same error about Environment Variables.


Is there any ideas about what I could do to fix it?


Thank you in advance.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 21 2013
Added on Jun 12 2012
4 comments
18,588 views