If you try to use the php_ibm_db2.dll that comes with the database while working with a WAMP server, you may have difficulties loading the ibm_db2 extension. You can understand this by checking the Apache error log.
This can be solved by downloading the correct dll by visiting http://sourceforge.net/projects/db2mc/files/ and then clicking "IBM_DB2 PHP Driver for Windows > PHP 5.(2|3)._ > VC(6|9) > php_ibm_db2-ver-(nts_ts)-vc(6|9)-x86.zip"
The correct dll version can be determined by checking the "Compiler" and "Thread Safety" fields on the php_info page.
Copy the dll to the extension directory, update the php.ini file, and restart the Apache service.
インストール手順
ibm_db2 拡張モジュールをビルドするには、 DB2 アプリケーション開発用のヘッダファイルおよびライブラリが システムにインストールされていなければなりません。 これらのファイルはデフォルトではインストールされないので、 DB2 のインストーラをもう一度起動して このオプションを追加する必要があります。 IBM DB2 Universal Database の » サポートサイト にてフリーで公開されている DB2 Application Development Client に、これらのヘッダファイルが含まれています。
既に DB2 がインストールされている Linux や Unix 上に DB2 アプリケーション開発用のヘッダおよびライブラリを追加した場合は、 DB2 インスタンス内のヘッダファイルやライブラリに対する シンボリックリンクを更新するため、 コマンド db2iupdt -e を実行しなければなりません。
ibm_db2 は » PECL 拡張モジュールなので、 PECL 拡張モジュールのインストール の手順にしたがって PHP にインストールすることができます。 まず、DB2 ヘッダファイルおよびライブラリの場所を指定するために 次のように configure コマンドを実行します。
bash$ ./configure --with-IBM_DB2=/path/to/DB2
注意: IIS ユーザー向けの注意
ibm_db2 ドライバを Microsoft Internet Information Server (IIS) で使用する場合は、以下ようにする必要があります。
- DB2 を、拡張オペレーティングセキュリティ (extended operating system security) つきでインストールします。
- PHP のバイナリへのパス (デフォルトは C:\php\) を、システムの環境変数 PATH に追加します。
- システムの環境変数をもうひとつ作成し、PHP.INI のある場所を指定します (例: PHPRC = C:\php\)。
- IUSR_COMPUTERNAME を DB2USERS グループに追加します。
rifat dot aras at gmail dot com
29-Apr-2012 02:02
angoca at yahoo dot com
25-Nov-2011 05: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 07: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 02: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 12: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
