Chapter 4. Deploying applications with DB2 171

Prerequisites

Before installing IBM_DB2 or PDO_IBM, you will require the following software.
4.4.4 PHP
PHP version 5 or greater is required for PDO_IBM and PHP version 4 or greater
is required for IBM_DB2. Most Linux and UNIX systems come with PHP
installed, but you might want to install a local copy of PHP on which you have full
control. You can download the latest PHP from:
http://www.php.net/downloads.php
For Windows, the binaries are also available on the same page. You can
optionally download PHP documentation from:
http://www.php.net/download-docs.php

IBM Data Server Driver for CLI support

All PHP interfaces communicate to DB2 using CLI. If either IBM Data Server
Client or IBM Data Server Runtime Client is present, this step is not required.
Otherwise, you will require IBM Data Server Driver for ODBC and CLI to run your
application. Alternatively, for Windows systems, you can use IBM Data Server
Driver for ODBC, CLI, and .NET. Both are described in detail in 4.1.2, “IBM Data
Server Driver for ODBC, CLI, and .NET, and IBM Data Server Driver for ODBC
and CLI” on page 143.

Installation procedure on Linux and UNIX

There are two ways to install the DB2 drivers for PHP. One is by installing DB2
products and the other is through building PHP drivers. The installation
procedure of PDO_IBM and IBM_DB2 is similar. The procedures discussed in
this section can be applied to both PDO_IBM and IBM_DB2.
Perform the following steps to install DB2 drivers for PHP from DB2 Clients:
1. Extract the drivers:
IBM DB2 version 9.5 Linux, UNIX, and Windows, IBM Data Server Client and
IBM Data Server Runtime Client are shipped with PHP driver files.
If your application is not on the same system as the DB2 server, or you only
require the drivers from the DB2 Clients, you can extract the driver files from
the DB2 products installed and placed them in a local directory.
Both DB2 drivers for PHP are located under <Path to sqllib>/sqllib/phpxx
(where xx is 32 or 64). They are ibm_db2_xx.so and pdo_ibm_xx.so (where xx is
the version). These drivers can be copied over to other systems of the same
platform.