Linux installation OCI extension

Source: Internet
Author: User
Tags phpinfo sqlplus

 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 ();
?>


  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.