PHP + IBM DB2 on Centos 7

Instalation of IBM DB2 module should be very easy (refering to the installation instructions):

  1. First of all, we need to download the driver package from here
  2. unpack the package to the server at /opt/ibm_db2/dsdriver
  3. chmod 755 installDSDriver
  4. ./installDSDriver
  5. Install pecl and php-pear (may need ksh): yum install php-pear
  6. pecl install ibm_db2
  7. When asked, provide the path to the db2 driver (here /opt/ibm_db2/dsdriver)
  8. You may check if it is installed by: pecl list
  9. Last thing: chmod o+w /opt/ibm_db2/dsdriver/cfg
  10. Edit /etc/php.ini and add extension=ibm_db2.so
  11. service httpd restart

Then in PHP:

Whole process with lot of pre-requisites for python is here (it works with little modifications for PHP too).