Jump to content

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...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.