Jump to content


Photo

ocilogon() [function.ocilogon]: _oci_open_server: ORA-12154:


  • Please log in to reply
3 replies to this topic

#1 diskhub

diskhub
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 12 January 2006 - 09:31 AM

Hi following is my code:
$conn = ocilogon('scott', 'tiger', 'customers');

$sql = "SELECT * from customers";
$q = ociparse($conn, $sql);
$results = ociexecute($q);

however, when ever i execute it in PHP5.0,
it gives me this error:

PHP Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12154: TNS:could not resolve the connect identifier specified in c:\Inetpub\wwwroot\orcl_test.php on line 13 PHP Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in c:\Inetpub\wwwroot\orcl_test.php on line 16 PHP Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in c:\Inetpub\wwwroot\orcl_test.php on line 17


#2 mstap42

mstap42
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 January 2006 - 03:11 PM

I've seen your error in my setup (IIS6/PHP5) whenever I've had the following problems in tnsnames.ora.

verify tnsnames.ora
-- path set in System Environment variables?
-- sytax (unmatched brackets?)
-- valid net service name

I found answers [a href=\"http://ora-12154.ora-code.com/\" target=\"_blank\"]here[/a].







#3 (V)ega

(V)ega
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 February 2006 - 06:20 PM

I'm having the same issue. I have tried alot everything I can find on the internet. I have set TNS_ADMIN in my environment variables. I keep getting the same error also:

Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12154: TNS:could not resolve the connect identifier specified in c:\Inetpub\wwwroot\index.php on line 2

My code looks like this:

<?
if ($c = OCILogon("sys","lizzie","TEST"))
{
echo "Connection to database successfull!";
OCILogOff($c);
}
else
{
$err = OCIError();
echo $err['message'];
}
?>

Can someone provide a step by step guide that will help alot of us out.

I'm running:

Windows XP Professional w/ SP2
Oracle 9i Database Release 2 Enterprise
PHP 5.0.4
IIS 5

Thanks in advanced

(V)ega

#4 trotski1977

trotski1977
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 November 2006 - 02:59 PM

try this format 4 the OCI conn

$conn = OCILogon("hr", "hr_password", '//mymachine.mydomain:port/MYDB);

eg:

$conn = OCILogon("Test", "TestPW", '//10.132.1.12:1021/LIMSLIVE);




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users