PHP5.2Oracle client extension (OCI8) installation in Linux

Source: Internet
Author: User
1. Download the Oracle Real-time 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) :( linux32-bit edition www.oracle.compolicysoftwaretechociinstantclientht

1. Download the Oracle Real-time client package Basic: all the 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) http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html (Linux 6)

  1. Download the Oracle Real-time client package-Basic: All files required to run OCI, OCCI, and JDBC-OCI applications

① Open the following website (This article uses the 32-bit version as an example ):
(Linux 32-bit) http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
(Linux 64-bit edition) 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. Install the Oracle Real-time 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 the built-in OCI8 in PHP, assuming that 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 (the content is as follows) and access it through the Web. If "oci8" exists, it indicates that the installation is successful.

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.