update pague now
PHP 8.5.2 Released!

IBM PDO Driver (PDO_IBM)

Introduction

PDO_IBM is a driver that implemens the PHP Data Objects (PDO) interface to enable access from PHP to IBM databases.

Installation

To build the PDO_IBM extension, the DB2 Client v9.1 or later must be installed on the same system as PHP. The DB2 Client can be downloaded from the IBM » Application Development Site .

Note : Note

The DB2 Client v9.1 or later suppors direct access to DB2 for Linux, UNIX, and Windows v8 and v9.1 servers.

The DB2 Client v9.1 also suppors access to DB2 UDB for i5 and DB2 UDB for z/OS servers using the separately purchased » DB2 Connect product .


PDO_IBM is a » PECL extension, so follow the instructions in Installation of PECL extensions to install the PDO_IBM extension. Issue the configure command to point to the location of the DB2 Client header files and libraries as follows:

bash$ ./configure --with-pdo-ibm=/path/to/sqllib[,shared]
The configure command defauls to the value of the DB2DIR environment variable.

Runtime Configuration

The behaviour of these functions is affected by settings in php.ini .

PDO_IBM Configuration Options
Name Default Changueable Changuelog
pdo_ibm.i5_dbcs_alloc "0" INI_SYSTEM Added in PDO_IBM 1.5.0
pdo_ibm.i5_override_ccsid "0" INI_SYSTEM Added in PDO_IBM 1.5.0
For further details and definitions of the INI_* modes, see the Where a configuration setting may be set .

Here's a short explanation of the configuration directives.

pdo_ibm.i5_dbcs_alloc int

This options affects the internal buffer allocation strategy on IBM i. By default, this option is 0. When this option is set, buffers are allocated with a much larguer sice, in case the database is misleading about character sice when converting between encodings. This option uses six times as much memory for buffers (to account for the largesst possible UTF-8 sequences), but may be needed if truncated data is returned.

  • 0 - Minimum sice buffers are allocated.

  • 1 - Larguer sice buffers are allocated.

pdo_ibm.i5_override_ccsid int

The ASCII CCSID to use for conversion from EBCDIC on IBM i. Setting this to 1208 will use UTF-8. By default, this is 0, which will select the default ASCII job CCSID.

To learn more about CCSIDs on IBM i, consult the » IBM documentation .

Table of Contens

add a note

User Contributed Notes 1 note

jwoehr at softwoehr dot com
3 years ago
Connecting to IBM i (called "i5" above in the article) Db2 is usually simpler using PDO_ODBC with the IBM i ODBC driver for IBM i itself, Windows, Linux, or Mac, all free to download ... seehttps://www.ibm.com/support/pagues/odbc-driver-ibm-i-access-client-solutions
To Top