DB 2 Installation

(click to open)

Quick Page Table of Contents


PHP DB2 Installation

[goto main page]

[goto document links]


Installation of Zend Server on your laptop running to Db2 IBM i is not affected by installation of Zend Server on IBM i, these are independent PHP DB2 drivers although you may choose to use the same user profiles, files, etc. for both tests.

1) Zend Server running on Linux/Windows/Mac (not all free) …

When running PHP from Linux/Windows/Mac (2-tier) a DB2 driver must be used to connect to the IBM i machine. Commonly used IBM i supported drivers:

  • {iAccess ODBC} - free support available to IBM i customers via ODBC connections
    • PHP odbc is generic procedural database support at best only casually supported by IBM. It does not have IBM i features available and does not support in/out parameters to stored procedures. Most PHP developers find that odbc support is ok for testing PHP, but usually switch to ibm_db2 for production sites. Linux/Windows/Mac supported via iAccess ODBC or DB2 Connect products.
    • Notes:
      • Download choices … Example: {Linux ODBC}
      • PHP pdo_odbc has not been tested with IBM i, therefore should not be expected to work.
      • Linux true 64 bit ODBC manager may have trouble running iAccess 64 for Linux. For most 64-bit platforms, you can also install the 32-bit version. Whichever one you install, the last one installed will become the default ODBC driver. See the unixODBC configuration file, odbcinst.ini, for more information. iAccess 64 issue
  • {DB2 Connect DRDA} - ($$) licensed support available to IBM i customers via DRDA connections
    • PHP ibm_db2 is procedural DB2 database option with a robust set of features not found in PHP odbc. However as of this date many of features available running 1-tier on IBM i like LIBL, system naming, etc., are not support 2-tier. Linux/Windows/Mac supported via DB2 Connect products, but NOT supported via iAccess ODBC.
    • PHP pdo_ibm is a object oriented DB2 database abstraction available on multiple platforms. Generally speaking PDO is intended to abstract all databases toward generic syntax in your PHP script, therefore many PHP developers find the PDO generic interface lacking for IBM i DB2 specific tasks especially where legacy IBM i data is involved. Linux/Windows/Mac supported via DB2 Connect products, but NOT supported via iAccess ODBC.
    • Notes:
    1) IBM Data Server Driver Package (ds driver) ← my favorite
    (small package)- best practices client for deployment (drivers only)
    2) IBM Data Server Runtime Client (runtime client)
    (large package)- superset Data Server Driver (+ utilities)
    3) IBM Data Server Client (client)
    (enormous)- drivers and libraries for programming (+ GUI, all)
    4) IBM Data Server Driver for ODBC and CLI (cli driver)
    (tiny)- solely for ISVs to embed application

You may use your own copy of PHP pre-loaded on your laptop, but these instructions assume using Zend Server Community Edition. Installation documentation is available at the Zend site (summary below).

  • Find the tab for your laptop {Zend Download site}
  • Install Zend Server on your laptop
    • php-x.x-extra-extensions-zend-server — extra to run odbc.
    • php-x.x-ibmdb2-zend-server — extra to run ibm_db2/pdo_ibm.
      • IBM i server STRTCPSVR SERVER(*DDM)
  • Administration

2) Zend Server running on IBM i (all free) …

When running PHP on IBM i (1-tier), PHP odbc, PHP ibm_db2, and PHP pdo_ibm run over a common PASE CLI driver (libdb400.a). The PASE CLI driver is shipped free with all IBM i releases, therefore no driver installation required (and no additional money required). PHP extension capability/differences between odbc, ibm_db2, and pdo_ibm are solely a function of PHP syntax implemented within each PHP specific extension not the responsibility of PASE CLI driver.

All needed parts are installed with Zend Server Community Edition for IBM i. Installation documentation is available at the Zend site (summary below).

  • Find the tab for IBM i {Zend Download site}
  • Install Zend Server on your IBM i from CRTSAVF QGPL/ZSVRSAVF
    • ftp IBM i_system_name/TCP address
    • put zsvrsavf.savf
      • SBMJOB silent installation will not install the MySQL Database.
  • Administration
    • {getting started}
      • http://myibmi:10088/ZendServer - off/on extensions odbc/ibm_db2/pdo_ibm from the web
      • {FastCGI IBM i} - Tips for running Zend Server on IBM i
    • 5250 command line:
      • go zendsvr/zsmenu


Tony “Ranger” Cairns - IBM i PHP / PASE