How to Install Oracle Instant Client and PHP OCI8 module
First download the oracle instant client basic and devel files from oracle website : http://www.oracle.com/technetwork/topics/linuxsoft-082809.html
from the oracle website and install them:
# rpm -ivh oracle-instantclient11.2-basic-220.127.116.11.0-1.i386.rpm # rpm -ivh oracle-instantclient11.2-devel-18.104.22.168.0-1.i386.rpm
Installing OCI8 from PECL
The OCI8 extension can be added to an existing PHP installation either automatically or manually from » http://pecl.php.net/. Information for installing this PECL extension may be found in the manual chapter titled Installation of PECL extensions. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: » http://pecl.php.net/package/oci8.
For an automated install follow these steps:
If you are behind a firewall, set PEAR’s proxy, for example:
pear config-set http_proxy http://my-proxy.example.com:80/
pecl install oci8
When prompted, enter either the value of $ORACLE_HOME, or instantclient,/path/to/instant/client/lib.
Note: Do not enter the variable $ORACLE_HOME because it will not be expanded. Instead, enter the actual path of the Oracle home directory.
For a manual install, download the PECL OCI8 package, e.g. oci8-1.3.5.tgz.
- Extract the package:
tar -zxf oci8-1.3.5.tgz cd oci8-1.3.5
- Prepare the package:
- Configure the package, either using $ORACLE_HOMEor Instant Client
if you get this error: checking Oracle Instant Client SDK header directory… configure: error: Oracle Instant Client SDK header files not found it means your oracle devel package didnt install correctly.
- Install the package:
After either an automatic or manual install, edit your php.ini file and add the line:
If you are having issues using oci_pconnect (causing apache segmentation faults) then you will need to use –with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client/lib and install the 1.3.0 version of the OCI client from http://pecl.php.net/package/oci8