Jump to content

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


diskhub

Recommended Posts

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 

  • 3 weeks later...

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].

 

 

 

 

 

 

  • 4 weeks later...

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

  • 9 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.