title: How to connect remote oracle database using php
body: <p>I have Oracle 10g installed on a windows server with a remote desktop virtual machine.<br/>
  I buy a hosting plan and host my php website on it, which is another server.</p>
  
  <p>I want to connect oracle database form that window server with my php website on another server. </p>
  
  <p>I have added the oci8 extension on my panel where my php files are hosting.</p>
  
  <p>I have static live public IP of the windows server where Oracle is installed.</p>
  
  <p>I want to connect them. But I got the error from the php file which says</p>
  
  <pre><code>TNS: no listener ORA-12541 error.
  </code></pre>
  
  <p>But when I connect php file to that oracle from my localhost with wamp server it connects but on the panel live it gives that error.</p>
  
  <pre><code>$username="uerp_adm";
  $password="DBPASSWORD";
  $tns2 = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERPUBLICIP WHERE ORACLE IS INSTALLED)(PORT = 1521)) (CONNECT_DATA = (SID = orcl)))";
  $conn=oci_connect($username,$password, $connstring);
  if($conn){
    echo 'CONNECTED';
  }
  else{
    echo 'NOT CONNECTED';
  }
  </code></pre>