Solved

PHP and oracle

Posted on 2000-04-27
2
317 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

860 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