I reinstalled my ye-old server today. It’s a old Celeron 700 with a whopping 512MB RAM! Even on this machine it’s possible to run the World’s Best Database: Oracle. I want to run this database (instead of “the usual” MySQL [also from Oracle nowadays :-) ] because I need PL/SQL (and PL/SQL rocks).
If you want to run this database on an Intel-based Debian machine, and also want to use PHP with Oracle, just do this (I assume you’ll already have Apache + PHP):
- Get Oracle 10g XE (it’s free).
- Use apt-get to install the packages gcc, make, libaio1, php-dev, php-pear (… if I’ve forgotten one, please apt-get it on-the-fly :-) ).
- Install the database using dpkg -i <oracle-xe DEB file>
- As root, run /etc/init.d/oracle-xe configure
- Install the oci8 module for PHP: pecl install oci8
Fill in the ORACLE_HOME. (see point below).
- Make sure you set the following exports (system-wide):
These environment variables must be known to Apache. Don’t have a nice solution for this yet (I’ve hacked it in a Apache startup script). But you can probably put this in the envvars script in Apache’s bin directory?
- Add extension=oci8.so to the php.ini. Don’t forget to set the extension_dir. If it’s already set, then you should put the oci8.so in that directory. By default pecl will put it somewhere in /usr/lib/php5
- Restart apache and you’re done!
For more info on oci8 installation: check the php.net website.