title: How to connect to a remote Oracle 11g database using PHP
body: <p>I have tried to make <code>oci_connect</code> work, by following <a href="https://help.ubuntu.com/community/PHPOracle" rel="nofollow">these directions</a>, but I still get the error:</p>
  
  <blockquote>
    <p>ora-24408 could not generate unique server group name in test.php</p>
  </blockquote>
  
  <p>Here is my PHP snippet (with bogus IP):</p>
  
  <pre><code>   $tns2 = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 123.123.123.123)(PORT = 1521)) (CONNECT_DATA = (SID = foo)))";
     if ($conn = oci_connect("username","pwd", $tns2))
     {
         echo "Connected to foo";
         oci_close($conn);
     }
     else
     {
         die("could not connect to foo");
     }
  </code></pre>
  
  <p>I use SQL Developer and can connect to this database just fine from this Ubuntu server. I also have Java applications that connect from this Ubuntu server to the remote Oracle database without any problems.</p>
  
  <p>What am I missing to make PHP work?</p>
  
  <p>I even did the <code>phpinfo()</code> and it showed the oci8 information.</p>