Install oci8 and pdo_oci extensions in CentOS5.5x86 _ 64

Source: Internet
Author: User
Related Environment already exists on the CentOS server: Apache2 and php5.3.3 need to be installed: Oracle client, pdo_oci extension, and oci8 extension Letsdoit! 1. File preparation 1) oracle client rpm package, http: www.oracle.compolicytechociinstantclientinstantclient.html download # oracle-instant

The CentOS server has related environments: Apache2,Php5.3.3

Installation required: Oracle client, pdo_oci extension, and oci8 Extension

Let's do it!

1. Prepare documents

1) oracle client rpm package,Download http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html

# 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
#
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm

2) pdo_oci and oci8 packages

# oci8-1.4.5.tgz   //  
#
PDO_OCI-1.0.tgz //

Free onHttp://linux.linuxIdC.com/

Both the user name and password areWww.linuxidc.com

The specific download directory is in/Pub/2011/10/20/CentOS 5.5 x86_64 install oci8 and pdo_oci extensions/

Ii. Install the oracle client

# rpm -ivh oracle-intstant*.rpm 

3. Configure oracle

1) Add a dynamic Loader

Modify the/etc/ld. so. conf file or add the oracle-x86_64.conf file under the ld. so. conf. d folder, write the following lib path to your installed oracle client:

/usr/lib/oracle/11.1/client64/lib/

2) A 32-bit soft link needs to be created for a 64-bit System (otherwise there will be problems in later installation, so I am stuck here for a long time)

# ln -s /usr/lib/oracle/10.2.0.3/client64 /usr/lib/oracle/11.1/client
#
ln -s /usr/include/oracle/10.2.0.3/client64 /usr/include/oracle/11.1/client

3) Modify/etc/proFileFile, and add the following content:

ExPort ORACLE_HOME=/Usr/Lib/Oracle/11.1/Client64/
ExportLD_LIBRARY_PATH
=/Usr/Lib/Oracle/11.1/Client64:$ LD_LIBRARY_PATH
Export NLS_LANG
="AMERICAN_AMERICA.AL32UTF8"
#Source/etc/profile // make it take effect 

4. Install pdo_oci

1)Extract, Enter the folder, no write

2) To avoid pdo_oci's lack of support for oracle11, make a fake ln and cheat Compilation

# ln -s /usr/include/oracle/11.1 /usr/include/oracle/10.2.0.1
#
ln -s /usr/lib/oracle/11.1 /usr/lib/oracle/10.2.0.1

3) Use phpize for extension, and execute phpize in the folder.

4) Compile

# ./configure --with-php-config=/usr/bin/php-config --with-pdo-oci=instantclient,/usr,10.2.0.1
#
make && make install

After the execution is completed, the last line shows that the pdo_oci.so file has been put into the php moDuUnder les, you only need to modify the php. ini file and add extension = pdo_oci.so.

5. Install oci8

Basically the same, decompress, enter, phpize, compile, and no conversion is required.

# ./configure --with-php-config=/usr/bin/php-config --with-pdo-oci=instantclient,/usr/lib/oracle/11.1/client64/lib
#
make && make install

Finally, modify the php. ini file. (the system configuration here is separated. Create an oci8.ini file in the/etc/php. d/folder. The content is still extension = oci8.so.

6. Check your 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.