Home » Open Source » Programming Interfaces » Oracle is not connecting with PHP/Apache on LINUX 5.2.0 ( Apache/2.2.17 (Unix) PHP/5.3.5 , Oracle 10.2.0)
Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492537] Tue, 01 February 2011 01:29 Go to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Hi Sir,
While connecting php with Oracle with OCI_CONNECT() function I am getting the following problem.
I will be very greatful if u will help me out to solve this 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 /usr/local/apache2/htdocs/test.php on line 3
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492540 is a reply to message #492537] Tue, 01 February 2011 01:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Do you use php in a program or through an application server?
Anyway, the one that execute the statement must have an Oracle client installed and its environment parameter ORACLE_HOME and LD_LIBRARY_PATH must point to this installation.

Regards
Michel
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492552 is a reply to message #492540] Tue, 01 February 2011 02:53 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
We don't need the oracle client because we have already installed the Oracle on that server.
Sir what do I do??
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492571 is a reply to message #492552] Tue, 01 February 2011 03:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Set ORACLE_HOME and LD_LIBRARY_PATH environment variables.
Ask the one that installed Oracle, it will give you the values.

Regards
Michel
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492582 is a reply to message #492571] Tue, 01 February 2011 04:37 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
I am facing the problem....
I have installed the oracle and already set the the environment variable which is
/u01/app/oracle/product/10.2.0/ora_1
and LD_LIBRARY _PATH is
/usr/local/apache2/lib:

What do I do Sir? Please suggest me..
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492604 is a reply to message #492582] Tue, 01 February 2011 06:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
LD_LIBRARY_PATH must also contains $ORACLE_HOME/lib.

Post the result of "env | sort" from the process that execute the script.

Regards
Michel
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492608 is a reply to message #492582] Tue, 01 February 2011 06:58 Go to previous messageGo to next message
ankit3010
Messages: 17
Registered: November 2010
Location: Indore
Junior Member
Sir can you tell me where is following Environment:-
LD_LIBRARY_PATH /usr/local/apache2/lib:
Re: Oracle is not connecting with PHP/Apache on LINUX 5.2.0 [message #492611 is a reply to message #492608] Tue, 01 February 2011 07:30 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
I don't know. Search in apache configuration file or php.ini.

Regards
Michel
Previous Topic: ORA-17410 No more data to read from socket
Next Topic: Present data in table from database in PHP
Goto Forum:
  


Current Time: Sat Dec 21 20:43:48 CST 2024