Wednesday, May 9, 2012

Install OCI8 in Centos/RedHat

Install OCI8 in Centos

Download OCI8 package from here
http://pecl.php.net/package/oci8
tar -xzvf oci-<VERSION>.tgz
cd oci-<VERSION>
phpize

1) Configure the PECL package as a shared object using the instant client and specifying where the Oracle client libraries are. Then build and install it.

./configure –with-oci8=instantclient,/usr/lib/oracle/<VERSION>/client/lib
make
make install

2) Add the library shared object for PHP

echo extension=oci8.so > /etc/php.d/oci8.ini

3) Start Apache

‘service httpd start’ _or_ ‘/etc/init.d/httpd restart’

4) Create a PHP info page and checked to see if the Oracle (oci8) driver is listed:

echo <? phpinfo(); ?> > /var/www/html/phpinfo.php

No comments:

Post a Comment