Friday, June 27, 2008

Installing oci8 on ubuntu 7.04 Feisty

Ubuntu has a simple way to turn into a web server.
To intall...
sudo tasksel install lamp-server

To uninstall...
apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 php5-common php5-mysql

However, Ubuntu's LAMP does not include a module for Oracle. So, in order to install oci module do following:
sudo apt-get install php5-dev pear-php

Download the Basic and the SDK packages from http://www.oracle.com/technology/tec...antclient.html. At the time of this writing, the filenames are instantclient-basic-linux32-10.2.0.1-20050713.zip and instantclient-sdk-linux32-10.2.0.1-20050713.zip.

Unzip these files in a new directory, e.g. /opt/oracle/instantclient.
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
echo /opt/oracle/instantclient >> /etc/ld.so.conf
ldconfig

The previous two lines are supposed to create symlinks named libclntsh.so and libocci.so which we will need later. In my case these symlinks were not created by ldconfig, so I created them manually.
ln -s libclntsh.so.10.1 libclntsh.so
ln -s libocci.so.10.1 libocci.so

Next line configure oci8 module for php
pecl install oci8

When installation prompt for instant client lib path, enter below line
'instantclient,/opt/oracle/instantclient'

Last, enter below line on /etc/php5/apache2/php.ini
extension=oci8.so

Hope every thing goes well.

Happy coding

No comments: