<p>On the latest Ubuntu, I have a functioning PHP 5.2.4 installation.  I want to use a remote Oracle server from PHP using OCI.</p>

<p>I've downloaded the <em>"Instant Client Package - Basic Lite"</em> (<a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html" rel="nofollow noreferrer">Link</a>). I've unzipped the package containing the OCI libraries to a dir but I have no idea how to tell PHP that I want to use these libraries. Predictably, I get</p>

<blockquote>
  <p>Fatal error: Call to undefined function oci_connect() in...</p>
</blockquote>

<p>when running this code:</p>

<pre><code>&lt;?php 
   $conn = oci_connect('hr', 'hrpw', 'someremotehost');
?&gt;
</code></pre>

<p>I don't want to recompile PHP with Oracle support.  What's the fastest way to wire up PHP so that I can use Oracle?  Do I need any other libaries, like the Oracle client if I want to connect to a remote Oracle instance?</p>

You need the PHP extension, try the following on your Ubuntu:
```
```
(sudo) pecl install oci8
```
```
Make sure your php.ini's (there should be one for your Apache and one for cli php) contain
```
extension=oci8.so
```
afterwards. Finally, you have to restart Apache and can confirm via
```
<?php phpinfo(); ?>
```
that the extension is loaded.
UPDATE:
Enter something like this when it asks you for ORACLE_HOME:
instantclient,/opt/oracle/instantclient
I think setting the environment variable would be another solution. /opt/oracle... is the path I put my instantclient in. I followed some tutorial a while ago, unfortunately I can't find it anmore.
HTH