Page 1 of 1

IBM i DB2 access from Local Wamp Stack

Posted: Thu Jan 19, 2017 2:51 pm
by dan8246
I'm not sure if this is the correct forum for this since I'm not using Zend Server on my local. But, I figured it's a PHP question having to do with the ibm_db2 driver and there would likely be individuals who are familiar with both here.

I'm trying to connect to an IBM i DB2 server from a local PC as part of a PHP application. I'm trying to set myself up for local development. Production runs off of Zend Server Professional directly on the system though.

I can't find a download for "IBM DB2 Universal Database client" and/or "IBM DB2 Connect" mentioned below. Has anyone done this before and could lend some insight? I'm open to alternate solutions so long as the db2_* functions are available. I'm working with existing code with no easy/quick way to switch between connection types between development and production.

I'm using a Bitnami Wamp stack (
I have downloaded the php_ibm_db2.dll from and added

Code: Select all

to my php.ini file.
I've confirmed the php.ini file is the one being used by checking the output of

Code: Select all

echo phpinfo();
and successfully modifying it.
I've also placed php_ibm_db2.dll in the location specified by the extension_dir directive.

Code: Select all

extension_dir = "C:\Bitnami\wampstack-5.6.29-1\php\ext"
The only PHP error I see logged is when I start up the server (which is still successful - albeit no db2_* functions).

Code: Select all

[18-Jan-2017 21:08:18 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Bitnami\wampstack-5.6.29-1\php\ext\php_ibm_db2.dll' - The specified module could not be found.

 in Unknown on line 0

[18-Jan-2017 21:08:19 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Bitnami\wampstack-5.6.29-1\php\ext\php_ibm_db2.dll' - The specified module could not be found.

 in Unknown on line 0
But the file

Code: Select all

does exist and has the same exact permissions as every other *.dll file in the directory (which has not been modified since the Wamp stack was installed).

I have read that "IBM DB2 Universal Database client" and "IBM DB2 Connect" must be installed on the same machine running PHP here ( but am having trouble finding a download for either. I can find instructions on how to install each, but no download link.

I've found a download for "IBM Data Server Client" which is behind a login on IBM's site. I'm wondering if this is one of the two programs I need installed just by a different name. I know name consistency isn't IBM's best attribute... :D

Re: IBM i DB2 access from Local Wamp Stack

Posted: Tue Jan 31, 2017 3:23 pm
by dan8246
I have some answers.

JDBC and ODBC support is free and it is typically shipped with other IBM software. This doesn't help in regards to db2_* functions in PHP.

If your DB2 database is on an IBM i or even Z/OS then the only way to do this is with DB2 Connect. There are a few different versions, but for workstation development you would want DB2 Connect Enterprise Edition. The downside is the smallest number of packages they currently offer is 25 at ~$3,800. This comes out to about $152/user but for a small shop with only 2 or 3 developers this is effectively out of the question unfortunately. At one point they did offer a 5 license package, but as of now they no longer offer it. Hopefully they will in the future.

If your DB2 database is on LUW then all you need is IBM Data Server Client which can be downloaded for free from here (requires IBM account though): ... lang=en_US

A potential alternative is to serve an API from the IBM i which is consumed by a local workstation during development of an application other than the API. However development of the API itself would still only be able to be done on the system AFAIK.

Hopefully this will save someone some time.