How to install oci8 for PHP 5 on Ubuntu
OCI8 is an extension for providing APIs to Oracle database management system. However, installing OCI8 is not just easy like apt-get since it requires SDK offered by Oracle and its distribution license prohibits the inclusion to linux distribution. That means we have to download and compile it by ourselves. Fortunately, it is a little bit easy for Ubuntu.
Install PEAR and PECL
sudo apt-get install php-pearDownload Oracle Instant Client. You need at least Basic and SDK.
Extract the archives.
sudo mkdir -p /opt/oracle cd /opt/oracle sudo unzip instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip sudo unzip instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip sudo mv /opt/oracle/instantclient_10_2 /opt/oracle/instantclientCreate symbolic links.
cd /opt/oracle/instantclient sudo ln -s libclntsh.so.10.1 libclntsh.so sudo ln -s libocci.so.10.1 libocci.soAdd instant client to system ld.
sudo su - echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclientCompile oci8.
sudo pecl install oci8Enter
instantclient,/opt/oracle/instantclientwhen you are prompted.Enable the extension.
sudo su - echo extension=oci8.so >> /etc/php5/apache2/php.iniRestart apache2.
sudo /etc/init.d/apache2 restart
- sugree's blog
- 6549 reads

compiling oci8
pecl and oci8
I recommend you to upgrade PECL and PHP since you may have an obsolete one. Otherwise, you might have to reinitialize the channel
pecl.php.netagain ifchannel-infogives failure result.Compiling oci8 - phpize error
You might need the php5-dev
sudo pecl install oci8/Compilling oci8
sudo is for users not logged
Post new comment