diskhub Posted January 12, 2006 Share Posted January 12, 2006 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 Link to comment https://forums.phpfreaks.com/topic/3181-ocilogon-functionocilogon-_oci_open_server-ora-12154/ Share on other sites More sharing options...
mstap42 Posted January 27, 2006 Share Posted January 27, 2006 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]. Link to comment https://forums.phpfreaks.com/topic/3181-ocilogon-functionocilogon-_oci_open_server-ora-12154/#findComment-11142 Share on other sites More sharing options...
(V)ega Posted February 18, 2006 Share Posted February 18, 2006 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 Link to comment https://forums.phpfreaks.com/topic/3181-ocilogon-functionocilogon-_oci_open_server-ora-12154/#findComment-11913 Share on other sites More sharing options...
trotski1977 Posted November 22, 2006 Share Posted November 22, 2006 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); Link to comment https://forums.phpfreaks.com/topic/3181-ocilogon-functionocilogon-_oci_open_server-ora-12154/#findComment-128555 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.