Solved

PHP and oracle

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

770 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