1. Download the Oracle Instant Client package -basic: All files required to run OCI, OCCI, and JDBC-OCI applications
①, open the following URL (this article takes the 32-bit version as an example):
(Linux 32-bit version)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
(Linux 64-bit version)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html
②, download the following files:
oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
2. Installing the Oracle Instant Client package
RPM-IVH oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
echo "/usr/lib/oracle/11.1/client/lib/" >/etc/ld.so.conf.d/oracle_client.conf
/sbin/ldconfig
3. Install OCI8 PHP extension (use PHP's own OCI8, assuming the PHP program is installed in/usr/local/webserver/php/)
Yum Install Libaio
wget http://pecl.php.net/get/oci8-1.3.5.tgz
Tar zxvf oci8-1.3.5.tgz
CD oci8-1.3.5/
/usr/local/webserver/php/bin/phpize
Cflags= "-i/usr/include/oracle/11.1/client/"
Cxxflags= "-i/usr/include/oracle/11.1/client/"
./configure--with-php-config=/usr/local/webserver/php/bin/php-config--with-oci8=/usr/lib/oracle/11.1/client/
Make
Make install
4. Modify the PHP configuration file (/usr/local/webserver/php/etc/php.ini)
Add a line after Extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/":
Extension = "oci8.so"
5. Restart PHP
6, create a phpinfo.php file (content as follows) and through the Web Access, if there is "Oci8" this item, it indicates that the installation was successful.
<?php
Phpinfo ();
?>