In our example, we place these files in the directory /home/user1/phpdrivers.

2.Create php.ini file:

Change to the lib directory where the PHP is installed. For example: cd /opt/www/php/lib

Create a php.ini file if there is not one already present:

touch php.ini vi php.ini

3.Add extension path and extension name in the php.ini file:

Example 4-16shows the lines that have to be added to the php.ini file. Add only the extension you will use. For example, if you are going to use ibm_db2_xx.so only, then you do not have to add pdo_ibm_xx.so in the php.ini file.

Example 4-16 Lines to added to php.ini file

extension_dir=/home/user1/phpdrivers extension=ibm_db2_xx.so extension=pdo_ibm_xx.so

4.PHP drivers is installed dynamically after adding the extension to the php.ini file. Check it with the following command:

php -m

This displays all extensions of PHP dynamically, hence the new additions will show immediately. Check for presence of ibm_db2 and pdo_ibm in the output. Example 4-17shows an abbreviated output.

Example 4-17 Output of php -m

itsouser@ubuntu:~$ php -m [PHP Modules]

ctype

...

ibm_db2

...

PDO pdo_ibm pdo_informix

...

zlib

[Zend Modules]

172DB2 Deployment Guide

Page 186
Image 186
IBM manual Example 4-16 Lines to added to php.ini file, Example 4-17 Output of php -m, 172 DB2 Deployment Guide