IBM DB2 Ubuntu 16
From DreamFactory
IBM's PDO_IBM driver is required for connecting to DB2 databases and must be compiled from source. Please follow these instructions.
- Get prerequisites from Apt
- <source lang="bash">$ sudo apt-get install ksh build-essential php7.1-dev</source>
- 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.
- Copy the downloaded tar.gz file to your home directory on the server.
- 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>
- 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>
- Symlink the include directory
- <source lang="bash">$ sudo ln -s /opt/dsdriver/include /include</source>
- Get the DF Patched version of the PDO_IBM Source
- <source lang="bash">$ cd ~</source>
- <source lang="bash">$ git clone https://github.com/dreamfactorysoftware/PDO_IBM-1.3.4-patched.git</source>
- 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>
- 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>
- Confirm proper php installation with
- <source lang="bash">$ php -m | grep pdo_ibm</source>
- 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>
- Nginx