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):
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE
export LC_ALL=C
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
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.
This is your new toolset in PHP. Happy coding. For writing PL/SQL on your new database, SQL Developer is a great IDE to use.
Nanne
3 years ago
Maaruhm, dat is een stuk simpelere installatie dan “apt-get install LAMP” :P
Oracle 10g XE + PHP on Debian | Debian-News.net - Your one stop for news about Debian
3 years ago
[...] 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. More here [...]
Uniform Rental
4 months ago
This actually is such a awesome write-up. I’ve been seeking for this information for quite a while now and then finally stumbled upon your internet web site. Thanks so considerably for posting this, this has helped me out tremendously. By the way I adore the style with the blog, looks very good, did you create it all by yourself?