IBM DB2

From DreamFactory
Jump to: navigation, search
Line 27: Line 27:
 
#* <source lang="bash">$ sudo make install</source>
 
#* <source lang="bash">$ sudo make install</source>
 
# Enable the driver in PHP
 
# Enable the driver in PHP
#* <source lang="bash">$ sudo nano /opt/bitnami/php/etc/php.ini</source>
+
#* <source lang="bash">$ sudo nano /etc/php/7.0/mods-available/pdo_ibm.ini</source>
#* Locate the line that says <code>;extension=pdo_ibm.so</code>
+
#* Edit this file so it reads <code>extension=pdo_ibm.so</code>
#* Uncomment it by removing the semicolon (;)  <code>extension=pdo_ibm.so</code>
+
#* Save the file and exit
 +
#* <source lang="bash">$ sudo phpenmod pdo_ibm</source>
 +
# Confirm proper php installation with
 +
#* <source lang="bash">$ php -m | grep pdo_ibm</source>

Revision as of 15:54, 8 November 2016

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
    • $ sudo apt-get install ksh build-essential php-dev
  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/
    • $ cd ~
    • $ tar -zxf ibm_data_server_driver_package_linuxx64_v11.1.tar.gz
    • $ sudo mv dsdriver /opt/
  5. Run the dsdriver installer
    • $ cd /opt/dsdriver
    • $ sudo chmod +x installDSDriver
    • $ sudo ksh installDSDriver
  6. Symlink the include directory
    • $ sudo ln -s /opt/dsdriver/include /include
  7. Get the DF Patched version of the PDO_IBM Source
    • $ cd ~
    • $ git clone https://github.com/dreamfactorysoftware/PDO_IBM-1.3.4-patched.git
  8. Compile and install the driver
    • $ cd PDO_IBM-1.3.4-patched
    • $ phpize
    • $ ./configure --with-pdo-ibm=/opt/dsdriver/lib
    • $ make
    • $ sudo make install
  9. Enable the driver in PHP
    • $ sudo nano /etc/php/7.0/mods-available/pdo_ibm.ini
    • Edit this file so it reads extension=pdo_ibm.so
    • Save the file and exit
    • $ sudo phpenmod pdo_ibm
  10. Confirm proper php installation with
    • $ php -m | grep pdo_ibm