Quantcast
Viewing all articles
Browse latest Browse all 7

How to Upgrade Oracle Instant Client Version for PHP OCI8 Extension

This article describes how to upgrade the Oracle Instant Client version (e.g. from 10.2 to 11.2) for Linux, PHP OCI8 Extension. The bit and version numbers have been omitted here. Replace ‘NN’ with the specific Linux x86 (32/64)-bit and Instant Client version.

Download the Basic and the SDK Instant Client (.ZIP) packages from the OTN Instant Client page (http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html) for your system.

Obtain the Basic and SDK Instant Client packages from the location above, and unzip them:

unzip -d /usr/local/ instantclient-basic-linuxNN.zip
unzip –d /usr/local/ instantclient-sdk-linuxNN.zip

 

This will unzip the files into /usr/local/instantclient_NN (e.g. /usr/local/instantclient_11_2)

Go to Instant Client directory:

 

cd /usr/local/instantclient_NN

Ensure there is a symbolic link for libclntsh.so:

ln -s libclntsh.so.NN  libclntsh.so

 

Go to PHP source directory:

cd /usr/local/src/php-NN

 

If you have built PHP before, we need to delete all the object files and executables.

make clean

Now, configure and build PHP. Adjust the path to Instant Client directory accordingly:

./configure … --with-oci8=instantclient,/usr/local/instantclient_NN …
make
make install

 

Use your usual procedure for re-starting Apache Web server, e.g.:

/etc/init.d/apachectl restart

To verify the PHP OCI8 Extension is installed correctly, create a PHP script; phpinfo.php in the Apache document root:

<?php
phpinfo();
?>

 

Access the phpinfo.php URL, browse to the “oci8” section, ensure the “Oracle Instant Client Version” is the version you want.


Viewing all articles
Browse latest Browse all 7

Trending Articles