Friday, June 6, 2014

Install PHP ibm_db2 extension in Linux (redHat)



Install PHP ibm_db2 extension in Linux (redHat) to make sb2_connect function worinkg in Linux:
1) check Linux version
uname -a
or
 uname -m
return
x86_64
2) Go to ibm db2 download website to Download Data Server Driver Package
 https://www-304.ibm.com/support/docview.wss?uid=swg27016878

fix pack: DSClients-linuxx64-dsdriver-10.5.0.3-FP003

IBM Data Server Driver Package (Linux/x86-64 64 bit) V10.5 Fix Pack 3
This is for PHP5.3
3) sudo mkdir /opt/ibm
cd /opt/ibm

download v10.5fp3_linuxx64_dsdriver.tar.gz

and upload to /opt/ibm
4) sudo tar -xvf v10.5fp3_linuxx64_dsdriver.tar.gz
cd /opt/ibm/dsddriver
sudo chmod 755 installDSDriver
5) Install ksh
sudo yum install ksh
6) Install ibm_db2 driver
sudo ksh installDSDriver
7) To make  phpize working which is needed for sudo pecl install ibm_db2
sudo yum install php-devel
8) sudo pecl install ibm_db2
export IBM_DB_HOME=/opt/ibm/dsdriver
sudo pecl install ibm_db2
9) in db2 install directory message, enter
/opt/ibm/dsdriver
10) return result
Build process completed successfully
Installing '/usr/lib64/php/modules/ibm_db2.so'
install ok: channel://pecl.php.net/ibm_db2-1.9.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=ibm_db2.so" to php.ini
/usr/lib64/php/modules/ibm_db2.so

11)  locate php.ini
/etc/php.ini
12)
 sudo vi  /etc/php.ini
add
extension=/usr/lib64/php/modules/ibm_db2.so
13) Restart Apache
 sudo service httpd restart

Reference:
http://www.php.net/manual/en/ibm-db2.installation.php

No comments:

Post a Comment