From YiPs Wiki (i powered)


(click to open)

Quick Page Table of Contents


Zend PHP Toolkit

Goto Main Page
Goto Documents

Who is this page for?

Instructions designed for IBM i developer learning PHP starting from ground zero …


On IBM i …

On laptop DRDA or ODBC …

1) Install PHP on your PC/laptop

Download Zend Server …

Download PHP toolkit and CW …
{Goto Main Page} and {Download Latest} version of PHP framework. This zip file contains all the PHP code required to use the new toolkit from your laptop (your DB2 Connect).

Follow the instructions below to install the php code (Linux, but Windows similar) …

cd /usr/local/zend/share
sudo unzip
sudo mkdir ToolkitApi
sudo mv ToolkitApi/.
sudo unzip
sudo gedit php.ini &
; UNIX: "/path1:/path2"
include_path = ".:/usr/local/zend/share/ToolkitApi:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear"
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

Note: If you are using the IBM i PTFS for XMLSERVICE change toolkit.ini: XMLServiceLib = “QXMLSERV”. Also check the lugconnect PHP script and change XMLSERVICE library to QXMLSERV as needed.

Run ibm_db2 to IBM i

Need some tests to try (a few include with XMLSERVICE) …

> call crttest

Step 2) Configuration

Step 3) Example - PGM complex data with DS

Example calling a typical IBM i functions with a few parameters.

How to select odbc or ibm_db2 (laptop)?

//The ToolkitService connection method/function uses either IBM_DB2(default)or ODBC extensions to connect
//to IBM i server. In order to switch to ODBC connection assign an "odbc' value to the $extension varibale
//and make sure that the ODBC extension is enabled in the PHP.INI file. 
try {
    $ToolkitServiceObj = ToolkitService::getInstance($db, $user, $pass, $extension);

    catch (Exception $e)
        echo  $e->getMessage(), "\n";

If you would like additional information on ibm_db2/ODBC connections to XMLSERVICE try these links.

Step 4) Disconnect

How you choose to run your toolkit will greatly affect the overall performance.


Tony “Ranger” Cairns - IBM i PHP / PASE

Retrieved from
Page last modified on October 18, 2013, at 01:36 PM EST