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-pear
-
Download 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/instantclient
-
Create symbolic links.
cd /opt/oracle/instantclient sudo ln -s libclntsh.so.10.1 libclntsh.so sudo ln -s libocci.so.10.1 libocci.so
-
Add instant client to system ld.
sudo su - echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient
-
Compile oci8.
sudo pecl install oci8
-
Enter
instantclient,/opt/oracle/instantclient
when you are prompted. -
Enable the extension.
sudo su - echo extension=oci8.so >> /etc/php5/apache2/php.ini
-
Restart apache2.
sudo /etc/init.d/apache2 restart
- sugree's blog
- 21174 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.net
again ifchannel-info
gives 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