ORA-DB-ONE

Integrate Oracle Instantclient with php( pecl install oci8 )

Posted in PHP Scripts by jackyoon on March 28, 2009

1. Download and install “Oracle Instant Client” from this URL.

Install oracle-instantclient-basic-10.2.0.4-1.i386.rpm
and oracle-instantclient-devel-10.2.0.4-1.i386.rpm

2. Install php-devel
# yun install php-devel

3. Install php-pear
# yum install php-pear

4. Install php-pecl-*
PECL is a repository for PHP Extension, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.

# yum install php-pecl-*

5. Install oci8 from pecl
# pecl install oci8

Provide ‘instantclient,/path/to/instant/client/lib’ once you got prompted to put the path.

or in case if you get below error.

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 23040 bytes) in /usr/share/pear/PEAR/PackageFile/v2/Validator.php on line 692

then peardev install pecl/oci8

6. Edit php.ini and confirm extension_dir points to the directory the oci8.so file was installed into.
Also in php.ini, enable the OCI8 extension with:

extension=oci8.so

7. Verify if oci8.so is loaded

<?php
phpinfo();
?>

Follow

Get every new post delivered to your Inbox.