LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2010, 02:47 PM   #1
vs224
LQ Newbie
 
Registered: Aug 2010
Posts: 8

Rep: Reputation: 0
Configure php to connect with oracle


Hi,

On RHEL 5.2, i have installed Oracle client 11.1 and Php 5.1.6. After that i somehow installed and configured oci8.so. When i do phpinfo Under oci8 it shows oci8 support enabled.

However on running php program that connect with oracle database i get following error

PHP Warning: oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: 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/index.php on line 5

Any help appreciated.

Thanks,
Vidya
 
Old 08-23-2010, 03:31 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,183

Rep: Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403
Quote:
Originally Posted by vs224 View Post
Hi,
On RHEL 5.2, i have installed Oracle client 11.1 and Php 5.1.6. After that i somehow installed and configured oci8.so. When i do phpinfo Under oci8 it shows oci8 support enabled.

However on running php program that connect with oracle database i get following error

PHP Warning: oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: 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/index.php on line 5
Well, did you check the system, as it told you?? ARE those environment variables set??? What user are they set for (keep in mind the Oracle user isn't the user that's running the WWW engine)?

And since you're using Oracle on RHEL...both are commercial products, and you're paying for support. Have you contacted them?
 
Old 08-24-2010, 12:43 PM   #3
vs224
LQ Newbie
 
Registered: Aug 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I am still unable to fix below error:

PHP Warning: oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: 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/index.php on line 5

Envionment variable are set to:

# more $ORACLE_HOME

*** /home/oracle/client/product/10.2.0/client_2: directory ***

# more $LD_LIBRARY_PATH
:/usr/lib:/usr/ucblib:/usr/local/lib:/lib:/home/oracle/client/product/10.2.0/client_2/lib:/usr/lib/oracle/11.1/client/lib:/usr/lib:/usr/ucblib:/usr/local/lib:/lib:/home/oracle/client/product/10.2.0/client_2/lib:/usr/lib/oracle/11.1/client/lib: No such file or directory

I don't understand what is meant by "please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories in /var/www/html/index.php on line 5"

I checked that ORACLE_HOME and LD_LIBRARY_PATH are set, but how can i check if they point to the right directories in /var/www/html

Any help appreciated.
 
Old 08-24-2010, 12:57 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,183

Rep: Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403
Quote:
Originally Posted by vs224 View Post
I am still unable to fix below error:

PHP Warning: oci_connect() [<a href='function.oci-connect'>function.oci-connect</a>]: 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/index.php on line 5

Envionment variable are set to:

# more $ORACLE_HOME

*** /home/oracle/client/product/10.2.0/client_2: directory ***

# more $LD_LIBRARY_PATH
:/usr/lib:/usr/ucblib:/usr/local/lib:/lib:/home/oracle/client/product/10.2.0/client_2/lib:/usr/lib/oracle/11.1/client/lib:/usr/lib:/usr/ucblib:/usr/local/lib:/lib:/home/oracle/client/product/10.2.0/client_2/lib:/usr/lib/oracle/11.1/client/lib: No such file or directory

I don't understand what is meant by "please check that ORACLE_HOME and LD_LIBRARY_PATH are set and point to the right directories in /var/www/html/index.php on line 5"

I checked that ORACLE_HOME and LD_LIBRARY_PATH are set, but how can i check if they point to the right directories in /var/www/html

Any help appreciated.
The error is very clear, and you need to re-read my original post.

You are checking those environment variables from a SHELL, which is NOT the same as a web page. You need to define those environment variables in that PHP page. No one here is going to be able to tell y ou what's 'right', since that's on your system...you will have to know where you set these things up.

And again...you're using Oracle on RHEL...both are commercial products, and you're paying for support. Have you contacted them???
 
Old 08-24-2010, 01:24 PM   #5
vs224
LQ Newbie
 
Registered: Aug 2010
Posts: 8

Original Poster
Rep: Reputation: 0
The environment variable are set on root. I don't understand how to
"define those environment variables in the PHP page".

However when i do phpinfo(), things look good oci8 support is enabled
Quote:
oci8
OCI8 Support enabled
Version 1.4.3
Revision $Revision: 300752 $
Active Persistent Connections 0
Active Connections 0
Oracle Version 11.2
Compile-time ORACLE_HOME /home/oracle/client/product/10.2.0/client_2/
Libraries Used -Wl,-rpath,/home/oracle/client/product/10.2.0/client_2//lib -L/home/oracle/client/product/10.2.0/client_2//lib -lclntsh
Temporary Lob support enabled
Collections support enabled
I am new and trying to learn this stuff, and will contact support if i am not able to figure out myself with your support.
 
Old 08-24-2010, 01:55 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,183

Rep: Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403Reputation: 4403
Quote:
Originally Posted by vs224 View Post
The environment variable are set on root. I don't understand how to
"define those environment variables in the PHP page".
Did you even try to look this up via Google?? If you're just learning PHP, check the books/manuals you're learning from.
http://php.net/manual/en/reserved.va...nvironment.php
Quote:
However when i do phpinfo(), things look good oci8 support is enabled
Nothing to do with support, you're not doing what you need to do. You need to perform the steps that are given to you by the error message
Quote:
I am new and trying to learn this stuff, and will contact support if i am not able to figure out myself with your support.
If you're paying for support, USE IT, that's what it's there for. You've been given the answer twice.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect oracle DB with G++ skie_knite007 Programming 1 12-04-2006 11:37 AM
qt connect Oracle nelnel Programming 0 07-21-2005 12:27 AM
PHP Oracle 9i Configure netpicker9 Mandriva 0 05-05-2005 01:47 AM
oracle 9i and php ronald_fancher Linux - General 9 03-04-2003 08:11 AM
How Do I Connect To Oracle Bheki Linux - Newbie 1 05-28-2002 06:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration