Installing OCI8 On Debian 5.0 i686

July 23rd, 2010 — 1:49pm

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

Comment » | Linux

Setting Up PHPMyAdmin

July 22nd, 2010 — 3:57pm

Related Post
* MySQL
* PHP
* Apache

Compiling libmcrypt

root@linux:~ # wget -c 'http://easynews.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz'
root@linux:~ # gunzip libmcrypt-2.5.7.tar.gz
root@linux:~ # tar -xvf libmcrypt-2.5.7.tar
root@linux:~ # cd libmcrypt-2.5.7
root@linux:~ # ./configure --disable-posix-threads
root@linux:~ # make && make install


Config mcrypt extension for PHP5

root@linux:~ # cd php-5.2.10/ext/mcrypt/
root@linux:~ # phpize ; aclocal
root@linux:~ # ./configure
root@linux:~ # make && make install
root@linux:~ # vi /usr/local/lib/php.ini
   #Add or Edit the following line#
   extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613/"
   extension=mcrypt.so

Config mbstring extension for PHP5

root@linux:~ # cd php-5.2.10/ext/mbstring/
root@linux:~ # phpize ; aclocal
root@linux:~ # ./configure
root@linux:~ # make && make install
root@linux:~ # vi /usr/local/lib/php.ini
   #Add or Edit the following line#
   extension=mbstring.so


Installing & Configure PHPMyAdmin

root@linux:~ # wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/2.11.10/phpMyAdmin-2.11.10-english.tar.gz?use_mirror=cdnetworks-us-2&ts=1279762815
root@linux:~ # tar -zxvf phpMyAdmin-2.11.10-english.tar.gz
root@linux:~ # mv phpMyAdmin-2.11.10-english.tar.gz /home/mywebsitehtdocs/phpmyadmin/
root@linux:~ # cd /home/mywebsitehtdocs/phpmyadmin/
root@linux:~ # cp config.sample.inc.php config.inc.php
root@linux:~ # vi config.inc.php
   $cfg['blowfish_secret'] = 'fdf943893h8fhu1imvzpe9'; ##Just type your long random character##
   $cfg['Servers'][$i]['AllowNoPassword'] = false;
   $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';

Restart Apache2

root@linux:~ # /usr/local/apache2/bin/apachectl restart

Comment » | Linux

Back to top