Chapter 4. Deploying applications with DB2 173
The PHP drivers are open source for you to build and install. The building DB2
PHP drivers will generate ibm_db2.so and pdo_ibm.so files. Once these files are
generated, you can follow steps 2 to 4 to install drivers.
The download sites and driver built instructions can be found in the following
URLs:
Download the source for IBM_DB2:
http://pecl.php.net/package/ibm_db2
Download the source for PDO_IBM from:
http://pecl.php.net/package/pdo_ibm
Build instructions:
http://in2.php.net/manual/en/install.pecl.php
The specific instructions for IBM_DB2 can be found at:
http://in2.php.net/manual/en/ibm-db2.installation.php
The specific instructions for PDO_IBM can be found at:
http://in2.php.net/pdo_ibm
Installation procedure on Windows
In the Windows environment, there are three way to install DB2 drivers.
First way: You can configure the environment using the PHP drivers shipped
with DB2 products. The required steps are as follows:
1. Add the drivers to the PHP extension directory.
If you have IBM DB2 version 9.5 Linux, UNIX, and Windows, IBM Data Server
Client, or IBM Data Server Runtime Client installed, you can find the driver
files under <Path to sqllib>/sqllib/phpxx (where xx is 32 or 64). The driver files
have the extension dll.
Copy and paste these files to the <PHP installation Path>/ext directory.
2. Open the php.ini file located in the PHP install path. Add the following lines at
the end of the file:
extension=php_ibm_db2.dll
extension=php_pdo_ibm.dll
3. PHP drivers should be installed now. Confirm the PHP driver installation by
issuing the following command:
php -m
Note: You will require sqllib include files to build the drivers. Install IBM Data
Server Client to build them.