PHP : Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in
<p>i am trying to connect Oracle and PHP, i followed PHP manual for connecting and connected success fully by this below way:</p>

<pre><code> oci_connect('Username','Password', ' (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = mymachine.oracle.com)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE)))' );
</code></pre>

<p>But Whenever i am using below method </p>

<pre><code>oci_connect('Username','Password', ,'MYDB');
</code></pre>

<p>i'm getting this error:</p>

<blockquote>
  <p>Warning: oci_connect(): ORA-12154: TNS:could not resolve the connect identifier specified in</p>
</blockquote>

<p>So, i have checked all the way some one said use Oracle client files i added tnsnames.ora,ORACLE_HOME,TNS_ADMIN and everything done, from the reference of previous questions but still the problem haven't resolved.</p>

<p>am i doing anything wrong, if please help me to get out from this problem.</p>

<p>Thanks in advance.</p>