Installing OCI8 On Debian 5.0 i686
OCI8 is an extension for providing APIs to Oracle database management system.
Requirement
* PHP
* Oracle Instant Client
Autoconf installation
root@linux:~# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz root@linux:~# tar -zvxf m4-1.4.9.tar.gz root@linux:~# cd m4-1.4.9/ root@linux:~# ./configure && make && make install root@linux:~# cd .. root@linux:~# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz root@linux:~# tar -zvxf autoconf-2.62.tar.gz root@linux:~# cd autoconf-2.62/ root@linux:~# ./configure && make && make install
Register and Download Oracle Instant Client. Choose your platform compatibility, if the package not compatible with your platform then installation process will failed. At least, we just need Basic and SDK. Then put on /opt/oracle or whatever directory did you liked.
root@linux:~# mkdir -p /opt/oracle root@linux:~# cd /opt/oracle root@linux:~# unzip instantclient-basic-linux32-11.2.0.1.zip root@linux:~# unzip instantclient-sdk-linux32-11.2.0.1.zip root@linux:~# mv /opt/oracle/instantclient_11_2 /opt/oracle/instantclient
Create symbolic links for dinamic library and Add instant client to system ld.
root@linux:~# cd /opt/oracle/instantclient root@linux:~# ln -s libclntsh.so.11.1 libclntsh.so root@linux:~# ln -s libocci.so.11.1 libocci.so root@linux:~# echo /opt/oracle/instantclient > /etc/ld.so.conf
Compiling OCI8 and enter instantclient,/opt/oracle/instantclient when you are prompted.
root@linux:~# pecl install oci8
Enable oci8 extension on php.ini then restart apache2 web server
root@linux:~# echo extension=oci8.so > /usr/local/lib/php.ini root@linux:~# echo extension=oci8.so > /etc/php5/cli/php.ini root@linux:~# sudo /etc/init.d/apache2 restart
Then check phpinfo() and the successfull installation should be :
I’ve got an error before, the error are no oci8 extensions on phpinfo() after installation finished and oci8.so added to php.ini. We can manually check with php command on console. And just install libaio with apt.
root@linux:~# php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/oci8.so' - libaio.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 root@linux:~# apt-get install libaio
Category: Linux | Tags: oci8, php-oracle Comment »
