Debian + PHP + Oracle
Here is what I did to let my (command line) PHP connect an Oracle
database. First I
downloaded
the Instant Client and converted it to Debian (everything done as root):
apt-get install alien
alien oracle-instantclient-basic-10.2.0.1-1.i386.rpm
alien oracle-instantclient-devel-10.2.0.1-1.i386.rpm
alien oracle-instantclient-sqlplus-10.2.0.1-1.i386.rpm
Then I installed the packages and repaired all the file
ownerships/permissions since they were unusable (might be solvable
with alien):
dpkg -i oracle-instantclient-basic_10.2.0.1-2_i386.deb
dpkg -i oracle-instantclient-devel_10.2.0.1-2_i386.deb
dpkg -i oracle-instantclient-sqlplus_10.2.0.1-2_i386.deb
chown -R root.root /usr/lib/oracle /usr/include/oracle /usr/share/oracle
chmod -R go+r /usr/lib/oracle /usr/include/oracle /usr/share/oracle
find /usr/lib/oracle /usr/include/oracle /usr/share/oracle -type d -exec chmod go+rx {} \;
Everything is installed in those three directories (plus the Debian
specific doc fragments). Now the libraries are to be made known to
everyone. Edit
/etc/ld.so.conf and add:
/usr/lib/oracle/10.2.0.1/client/lib
Now update the linker cache:
ldconfig
The PHP extension itself is installed with PHP Pear/PECL:
apt-get install php4-pear
pear install oci8
When prompted, type
instantclient,/usr/lib/oracle/10.2.0.1/client/lib. After the
extension is installed, activate it by editing
/etc/php4/cli/php.ini and adding
extension=oci8.so
This will install the most current API version, so even the stuff
marked as being PHP 5 works in PHP 4. This should work with
CGI/Apache-Versions of PHP, just make sure ldconfig has been run
before the server starts.