If you want to connect to an Oracle database with PHP5, you can use Oracle's Instant Client and the oci8 module from pear.
This is how did it on a Debian Sarge server running PHP5 and apache. I started with a post on the Ubuntu support forums. It got me close but not all the way there. So this is step by step how I got it running.
Download the Basic and the SDK packages from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html. At the time of this writing, the filenames are instantclient-basic-linux32-10.2.0.2-20060331.zip and instantclient-sdk-linux32-10.2.0.1-20050713.zip.
Unzip these files in a new directory:
mkdir -p /opt/oracle/instantclient
cd /opt/oracle/instantclient
unzip instantclient-basic-linux32-10.2.0.1-20050713.zip
unzip instantclient-sdk-linux32-10.2.0.1-20050713.zip
cd instantclient_10_2
ln -s libclntsh.so.10.1 libclntsh.so
ln -s libocci.so.10.1 libocci.so
In the next step we will download the oci8 module with pear. Pear is in the php-pear package.
apt-get install php-pear
pecl install oci8
At the prompt the following excerpt enter "shared,instantclient,/opt/oracle/instantclient/instantclient_10_2" without the ".
downloading oci8-1.2.1.tar ...
Starting to download oci8-1.2.1.tar (-1 bytes)
.....................................................................................................done: 499,200 bytes
10 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
Please provide the path to ORACLE_HOME dir. Use 'instantclient,/path/to/instant/client/lib' if you're compiling against Oracle Instant Client [autodetect] :
You should now find the library in:
/usr/local/src/oci8-1.2.0/.libs/
Copy the library to the PHP5 build dir:
cp /usr/local/src/oci8-1.2.0/.libs/oci8.so /usr/lib/php5/20050922/oci8.so
To enable the oci8 module in the php.ini (/etc/php5/apache2/php.ini and /etc/php5/cli/php.ini), add a line
extension=oci8.so (put this line after the examples starting with ;extension).
Now stop and start Apache. You should see the oci8 module in the output of phpinfo().
Hope this helps you
// Bjarne Østby