安装/配置
在线手册:中文 英文
PHP手册

安装

To build the ibm_db2 extension, the DB2 application development header files and libraries must be installed on your system. DB2 does not install these by default, so you may have to return to your DB2 installer and add this option. The header files are included with the DB2 Application Development Client freely available for download from the IBM DB2 Universal Database » support site.

If you add the DB2 application development header files and libraries to a Linux or Unix operating system on which DB2 was already installed, you must issue the command db2iupdt -e to update the symbolic links to the header files and libraries in your DB2 instances.

ibm_db2 is a » PECL extension, so follow the instructions in PECL 扩展库安装 to install the ibm_db2 extension for PHP. Issue the configure command to point to the location of your DB2 header files and libraries as follows:

bash$ ./configure --with-IBM_DB2=/path/to/DB2
The configure command defaults to /opt/IBM/db2/V8.1.

Note: Note for IIS users

If you are using the ibm_db2 driver with Microsoft Internet Information Server (IIS) you may have to do the following:


安装/配置
在线手册:中文 英文
PHP手册
PHP手册 - N: 安装

用户评论:

angoca at yahoo dot com (25-Nov-2011 04:29)

In DB2 v9 the clients have changed their names. Now, they are called

Data server client

If you search in Internet "DB2 fixpack" you will get an IBM address like

http://www-01.ibm.com/support/docview.wss?uid=swg24031181

You select the DB2 version and fixpack level, then the platform and finally the product, that in this case is "Data Server client"

kpfitzgerald at gmail dot com (01-Apr-2011 06:14)

Actually a much simpler way on SLES 11 SP1 and DB2 Express C  is to execute the following.

pecl install ibm_db2

when it asks for your path put in your location of SQLLIB not your db2 install. usually found here...

/home/db2inst1/sqllib

to verify execute
pecl list

Should show the following:

Installed packages, channel pecl.php.net:
=========================================
Package Version State
ibm_db2 1.9.1   stable

hellboy1975 at gmail dot com (30-Jul-2010 01:12)

Took me a little while to found this, so I thought it may help someone else down the track.  You can grab the latest versions of the php_ibm_db2.dll files for Windows IIS & PHP5+ from this site on Sourceforge:

http://sourceforge.net/projects/db2mc/files/

AngocA (27-Mar-2009 11:12)

I installed this tool foolwing the next steps:

(Prereq: I've installed DB2 express-c before, and also Apache and php)

- Download the file: ibm_db2-1.8.2.tgz
- Untar the file: tar -xvf ibm_db2-1.8.2.tgz
- Go to the main directory
- Execute 'phpize' and that creates several files.
- Execute './configure --with-IBM_DB2=/opt/ibmn/db2/V9.5_01'
- Execute 'make'
- Execute 'make install'
- Modify the php.ini file in order to activate the ibm_db2.so extension.
    extension=ibm_db2.so

To check that the library is included: php -i

Then, you have to restart Apache: httpd -k restart