This post helped me install Oracle XE on my developer machine successfully!

It worked for my Debian Lenny system previously, and now it’s tested to work with MEPIS 8.0, Ubuntu 9.04 and Linux Mint 7 as well.

1. Oracle Express Edition
This step is optional if you already have a server to use, but my inexperience it’s far better to have one local.

First you need to add this line to your /etc/apt/sources.lst:

deb http://oss.oracle.com/debian unstable main non-free

Then run the following commands:

su
wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -
apt-get update
apt-get install oracle-xe

It’s a big .deb file, 210.4MB to be exact. The installation, like most in Debian systems is a breeze. When the installer completes there is one extra step:

su
/etc/init.d/oracle-xe configure

You’ll be asked to create a system/sys (administrative user) password, and whether or not to start Oracle on boot.

2. oci8 static object
With oracle-xe successfully installed, we’ll focus on getting Oracle and PHP to place nice.

I downloaded the RPM versions of these files from here:

oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-jdbc-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-odbc-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-tools-11.1.0.7.0-1.i386.rpm

I’m sure that not all of the RPMs are required, so maybe you can try just basic, devel if you like. No guarantees, though.

I also converted it to deb using alien (which you may not have, but can install using ’sudo apt-get install alien’, and then installed:

sudo alien oracle*.rpm
sudo dpkg -i oracle*.deb

You need to log in to your oracle.com account and accept the software license.

You’ll need the ‘pecl’ command, which is available in php-pear, php5-dev:

sudo apt-get install php-pear php5-dev
sudo pecl install oci8

Input “1″ and hit Enter, then type (or paste) the following text.

instantclient,/usr/lib/oracle/11.1/client/lib

When you’re done, hit Enter twice to begin compilation. It takes awhile.

You’ll need to add one line to the end of your php.ini file:

sudo pico /etc/php5/apache2/php.ini

Page Down to the bottom, then add “extension=oci8.so”, and then Ctrl + X, Y to save. Repeat for the cli version too, found in /etc/php5/cli/php.ini.

Lastly, restart Apache:

/etc/init.d/apache2 restart