PHP 8.4.1 Released!

Installazione

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

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

ibm_db2 is a » PECL extension, so follow the instructions in Installation of PECL extensions to install the ibm_db2 extension for PHP. Issue the configure command to point to the location of the 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.

Nota: Note for IIS users

If the ibm_db2 driver is being used with Microsoft Internet Information Server (IIS), it may be necessary to do the following:

  • Install DB2 with extended operating system security.
  • Add the PHP binary path to the PATH system environment variable (default C:\php\).
  • Create another system environment variable equal to the path where the PHP.INI file is located (eg: PHPRC = C:\php\).
  • Add the IUSR_COMPUTERNAME to the DB2USERS group.

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 packages
apt-get install php-pear ksh zip

#2- Make directory
mkdir /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)
or
tar -xvf v10.5fp1_linuxia32_dsdriver.tar.gz (linux32)

#5- Change permission instalation script - /opt/ibm/dsddriver
chmod 755 installDSDriver

#6- Run the installation script
ksh installDSDriver

#7- Download and install the driver using the pecl
pecl install ibm_db2

downloading ibm_db2-1.9.5.tgz ...
Starting to download ibm_db2-1.9.5.tgz (157,720 bytes)
................done: 157,720 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626

#8- Configure the installation directory
DB2 Installation Directory? : /opt/ibm/dsdriver

Build process completed successfully
Installing '/usr/lib/php5/20090626/ibm_db2.so'
install ok: channel://pecl.php.net/ibm_db2-1.9.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=ibm_db2.so" to php.ini

#9- Change php.ini
vim /etc/php5/apache2/php.ini
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension = ibm_db2.so
extension = /usr/lib/php5/20090626/ibm_db2.so

#10- Reboot the Apache
service apache2 restart
up
2
kpfitzgerald at gmail dot com
13 years ago
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
To Top