Linux PhP5 oci pdo install

Source: Internet
Author: User

 

 

1) install the Oracle client package

1> View the Linux system:

Uname-m

If the information contains 64, it indicates that your Linux system is a 64-bit system. If not, it is a 32-bit system. Download the corresponding package. This is a 64-bit system. Go to the (Linux 64-bit edition) http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html to download

 

Oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm

Oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm

Sdk-11.1.0.7.0-linux-x86_64.zip

 

2> Installation

# Install it under/usr/lib/Oracle/11.1/client64/by default

 

Rpm-IVH oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm 

 

# Default installation to/usr/include/Oracle/11.1/client64/

 

Rpm-IVH oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm 

 

Note: in Linux x86_64, perform the following settings:

 

Ln-S/usr/lib/Oracle/11.1/client64/usr/lib/Oracle/11.1/client <br/> ln-S/usr/include/Oracle/11.1/client64 /usr/include/Oracle/11.1/client 

 

3> decompress the SDK and copy the SDK package to/usr/include /.

 

Unzip sdk-11.1.0.7.0-linux-x86_64.zip <br/> CP-fr instantclient_11_1/SDK/usr/include/ 

 

4> set ORACLE_HOME and LD_LIBRARY_PATH and nls_lang

 

Add the following three lines at the end of the/etc/profile file:


Export ORACLE_HOME =/usr/lib/Oracle/11.1/client64/<br/> export LD_LIBRARY_PATH =/usr/lib/Oracle/11.1/client64: $ LD_LIBRARY_PATH <br/> export nls_lang = "american_america.al32utf8" 

 

Make the environment variable take effect.

 

[Root ~] # Source/etc/profile 

 

2) install pdo_oci

1> install re2c

Download wget http://downloads.sourceforge.net/re2c/re2c-0.12.3.tar.gz

 

Tar zxvf re2c-0.12.3.tar.gz <br/> Cd re2c-0.12.3 <br/>./configure <br/> make install 

 

2> install pdo_oci

If php5.3 or later, the original file with pdo_oci exists in the php-5.3.X/EXT/pdo_oci/, if yes, the compilation file does not need to be downloaded.

Download wget http://pecl.php.net/get/PDO_OCI-1.0.tgz

 

Tar xzvf PDO_OCI-1.0.tgz <br/> Cd PDO_OCI-1.0 <br/>/usr/local/webserver/PHP/bin/phpize <br/> ln-S/usr/include/Oracle/11.1 /usr/include/Oracle/10.2.0.3 <br/> ln-S/usr/lib/Oracle/11.1/usr/lib/Oracle/10.2.0.3 <br/>. /configure -- With-PDO-OCI = instantclient,/usr, 10.2.0.3 <br/> make install 

 

If the following error occurs during compilation: Make: *** [pdo_oci.lo] Error 1 or make: *** [pdo_oci.la] Error 1, the OCI library file is missing, copy the library file to the compilation directory:

 

CP-F/usr/include/Oracle/10.2.0.3/client64/* include/ 

 

Re-compile:

 

 

Make & make install 

 

After compilation is complete, the no-debug-non-zts-20090626 directory is added to the/usr/local/lib/PHP/extensions directory, and the pdo_oci.so file is generated under/usr/local/lib/PHP/extensions/no-debug-non-zts-20090626.

 

3) Modify PHP. ini

Add

 

Extension = "/usr/local/lib/PHP/extensions/no-debug-non-zts-20090626/pdo_oci.so" 

 

Php-M | grep PDO check whether the extension is successful. If the following extension exists, the extension is successful.

 

PDO

Pdo_oci


 

 

 

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.