Solved

PHP and oracle

Posted on 2000-04-27
2
326 Views
Last Modified: 2008-03-17
we are not able to connect oracle client on linux. using either odbc_connect,ora_logon or ocilogon.
$cnx = Ora_Logon('portal@PHPora.apcosoft.soft.net','portal');

It gives the TNS : could not resolve service name.
0
Comment
Question by:balasundaram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
us111 earned 100 total points
ID: 2758407
Do you have your DNS configured?
0
 
LVL 1

Expert Comment

by:aikon
ID: 2789363
Hi balasudaram,

Please check:
1.- You had set the LD_LIBRARY_PATH in your php scripts
2.- TNSNAMES.ORA is accessible to Apache (apache user is 'nobody' by default)
3.- Test if your Oracle server is visible from your webserver machine:"$ tnsping <database_name>"


Example:
<?php
 putenv("LD_LIBRARY_PATH=LD_LIBRARY_PATH=/u01/app/oracle/lib");

$cnx = Ora_Logon('portal@PHPora.apcosoft.soft.net','portal');
?>

Regards.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question