1

i am trying to connect a php script to remote oracle DB but after following this article, I got this error message:

A PHP Error was encountered

Severity: Warning

Message: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified

Filename: controllers/cancel.php

Line Number: 13

Does anyone know what the problem might be?

Bohemian
  • 412,405
  • 93
  • 575
  • 722
Ahmad Sobh
  • 11
  • 1
  • Does the remote DB allow connections from remote location? confirm it – Wearybands Sep 11 '12 at 11:58
  • It looks like your `oci` is having problems finding the right database. From memory, oci uses an Oracle Instant Client to make the connection, which in turn uses a TNSNames file to list the connections. Have you got the right entry in there for the database? – Fluffeh Sep 11 '12 at 11:58
  • Check whether your Oracle server instance is running fine and double check your connection string is ok. – PCoder Sep 11 '12 at 11:58
  • You might not have heard of google, it's quite new, give it a try [with your search query](http://www.google.nl/#hl=nl&output=search&sclient=psy-ab&q=oci_connect():+ORA-12154%3A+TNS%3Acould+not+resolve+the+connect+identifier+specified&oq=oci_connect():+ORA-12154%3A+TNS%3Acould+not+resolve+the+connect+identifier+specified&gs_l=hp.3...260.260.0.395.1.1.0.0.0.0.0.0..0.0...0.0...1c.1j2.JN5r6Y52adk&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=3d666e071cd6d452&biw=1320&bih=821) – dbf Sep 11 '12 at 11:59
  • i am using toad and it connecting normally – Ahmad Sobh Sep 11 '12 at 11:59
  • @dbf u surprised me with ur valuable answer :| – Ahmad Sobh Sep 11 '12 at 12:01
  • @AhmadSobh I always try not to be that ironic, but I do hope I surprised you with the first result where it said **[SOLVED] ORA-12154: TNS:could not resolve the connect identifier specified (Read 85354 times)**, and your welcome. – dbf Sep 11 '12 at 12:05
  • what if i told u that i have googled that for the past two days and i didn't find any suitable answer!!!, so don't put urself in the smart guy suit and others are dump :) – Ahmad Sobh Sep 11 '12 at 12:22

0 Answers0