0% found this document useful (0 votes)
62 views2 pages

Instant Client Oci8

The document provides instructions for installing the Oracle Instant Client on an Ubuntu server to allow PHP applications to connect to an Oracle database. It involves downloading the Instant Client files, extracting and setting symlinks. It also covers installing the OCI8 PHP extension and configuring Apache to load the extension and restarting Apache. Finally, it describes verifying the installation by checking for the OCI8 section in a phpinfo page.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views2 pages

Instant Client Oci8

The document provides instructions for installing the Oracle Instant Client on an Ubuntu server to allow PHP applications to connect to an Oracle database. It involves downloading the Instant Client files, extracting and setting symlinks. It also covers installing the OCI8 PHP extension and configuring Apache to load the extension and restarting Apache. Finally, it describes verifying the installation by checking for the OCI8 section in a phpinfo page.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Installing the Oracle Instant Client Files

1. Download the Oracle Instant Client for Linux (Both the Basic and SDK versions) from here.
Make sure you choose the correct architecture for your Ubuntu installation (32bit is x86, 64bit
is x86_64).
2. Copy the files just downloaded to your Ubuntu server using scp or the WinSCP application for
windows.
3. ssh into your ubuntu server using your favorite ssh client
4. Install PECL, PHP Development files, Build Essential, Unzip, and the AIO Library
apt-get install php-pear php5-dev build-essential unzip

5. Create the oracle directory


mkdir /opt/oracle

6. Move the downloaded files


mv instantclient-* /opt/oracle

7. Unzip the files using the unzip command (unzip <filename>)


8. Rename the created directory
mv instantclient_11_2 instantclient

9. cd into the instant client directory and create the following soft links
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so

10. cd to /opt
11. set the permissions on the directory
chown -R root:www-data /opt/oracle

12. Add the instant client to the the ld config files


echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient

13. Update the Dynamic Linker Run-Time Bindings


ldconfig

Installing OCI 8 and Configuring Apache


1. Install OCI8 using PECL
download oci8 http://pecl.php.net/package/oci8

extrack
phpize

./configure --with-oci8=shared,instantclient,/opt/oracle/instantclient

make install

2. Add the extension to the php.ini files


echo extension=oci8.so >> /etc/php5/apache2/php.ini
echo extension=oci8.so >> /etc/php5/cli/php.ini

3. Restart Apache
/etc/init.d/apache2 restart

4. Verify the installation of the OCI8 library by creating a simple phpinfo page.
touch info.php; echo "<?php phpinfo(); ?>" > info.php

5. Navigate to the page using your favorite web browser and confirm the OCI8 section is present.

You might also like