インストール手順

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
configure コマンドのデフォルト値は /opt/IBM/db2/V8.1 となっています。

注意: 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 グループに追加します。

add a note

User Contributed Notes 2 notes

up
29
jean dot ferreira at gmail dot com
11 years ago
==Installation ibm_db2 in PHP5, using Data Server Driver Package and pecl on Debian / Ubuntu====Advantages==#You do not need DB2 (database) installed#The ibm_db2 driver is downloaded and automatically compiled by pecl==Steps==#1- Install packagesapt-get install php-pear ksh zip#2- Make directorymkdir /opt/ibm #3- Download Data Server Driver Package (dsdriver), as the architecture(https://www-304.ibm.com/support/docview.wss?rs=4020&uid=swg27016878&wv=1)#4- Decompress dsdriver at /opt/ibm/tar -xvf v10.5fp1_linuxx64_dsdriver.tar.gz  (linux64)ortar -xvf v10.5fp1_linuxia32_dsdriver.tar.gz (linux32)#5- Change permission instalation script  -  /opt/ibm/dsddriverchmod 755 installDSDriver#6- Run the installation script ksh installDSDriver#7- Download and install the driver using the peclpecl install ibm_db2downloading ibm_db2-1.9.5.tgz ...Starting to download ibm_db2-1.9.5.tgz (157,720 bytes)................done: 157,720 bytes5 source files, buildingrunning: phpizeConfiguring for:PHP Api Version:         20090626Zend Module Api No:      20090626Zend Extension Api No:   220090626#8- Configure the installation directoryDB2 Installation Directory? : /opt/ibm/dsdriverBuild process completed successfullyInstalling '/usr/lib/php5/20090626/ibm_db2.so'install ok: channel://pecl.php.net/ibm_db2-1.9.5configuration option "php_ini" is not set to php.ini locationYou should add "extension=ibm_db2.so" to php.ini#9- Change php.inivim /etc/php5/apache2/php.ini;;;;;;;;;;;;;;;;;;;;;;; Dynamic Extensions ;;;;;;;;;;;;;;;;;;;;;;;extension = ibm_db2.soextension = /usr/lib/php5/20090626/ibm_db2.so#10- Reboot the Apacheservice apache2 restart
up
2
kpfitzgerald at gmail dot com
14 years ago
Actually a much simpler way on SLES 11 SP1 and DB2 Express C  is to execute the following. pecl install ibm_db2when it asks for your path put in your location of SQLLIB not your db2 install. usually found here... /home/db2inst1/sqllibto verify execute pecl listShould show the following: Installed packages, channel pecl.php.net:=========================================Package Version Stateibm_db2 1.9.1   stable
To Top