IBM DB2 Ubuntu 16

From DreamFactory
Jump to: navigation, search

IBM's PDO_IBM driver is required for connecting to DB2 databases and must be compiled from source. Please follow these instructions.

  1. Get prerequisites from Apt
    • <source lang="bash">$ sudo apt-get install ksh build-essential php7.1-dev</source>
  2. Get the dsdriver package from IBM.
    • You can download the package from here. Grab the Linux 64 bit package.
    • This download requires you to register for a free account with IBM.
  3. Copy the downloaded tar.gz file to your home directory on the server.
  4. Uncompress the package and move it to /opt/
    • <source lang="bash">$ cd ~</source>
    • <source lang="bash">$ tar -zxf ibm_data_server_driver_package_linuxx64_v11.1.tar.gz</source>
    • <source lang="bash">$ sudo mv dsdriver /opt/</source>
  5. Run the dsdriver installer
    • <source lang="bash">$ cd /opt/dsdriver</source>
    • <source lang="bash">$ sudo chmod +x installDSDriver</source>
    • <source lang="bash">$ sudo ksh installDSDriver</source>
  6. Symlink the include directory
    • <source lang="bash">$ sudo ln -s /opt/dsdriver/include /include</source>
  7. Get the DF Patched version of the PDO_IBM Source
  8. Compile and install the driver
    • <source lang="bash">$ cd PDO_IBM-1.3.4-patched</source>
    • <source lang="bash">$ phpize</source>
    • <source lang="bash">$ ./configure --with-pdo-ibm=/opt/dsdriver/lib</source>
    • <source lang="bash">$ make</source>
    • <source lang="bash">$ sudo make install</source>
  9. Enable the driver in PHP
    • <source lang="bash">$ sudo sh -c 'echo "extension=pdo_ibm.so" > /etc/php/7.1/mods-available/pdo_ibm.ini'</source>
    • <source lang="bash">$ sudo phpenmod pdo_ibm</source>
  10. Confirm proper php installation with
    • <source lang="bash">$ php -m | grep pdo_ibm</source>
  11. Restart the PHP-FPM and Nginx or Restart Apache (whichever solution you're using.)
    • Nginx
      • <source lang="bash">$ sudo service php7.1-fpm restart && sudo service nginx restart</source>
    • Apache
      • <source lang="bash">$ sudo service apache2 restart</source>