----- Run DB2 as a Docker Container -----
docker run -d --restart always -p 50000:50000 --name any-name --privileged=true -e LICENSE=accept -e DB2INST1_PASSWORD=123 -e DBNAME=any-name -v set-path-on-local:/database ibmcom/db2
----- To get into the DB2 container -----
docker exec -it container-name bash
----- Steps to install DB2 Driver -----
1- Install packages:
apt-get install php-pear ksh zip
2- Make directory:
3- Copy Data Server Driver Package (dsdriver):
Shared drive path: \\192.168.99.15\Public\softwares\DB
ibm_data_server_driver_package_linuxx64_v11.1.tar.gz
ibm_db2-2.0.8.tgz
4- Decompress dsdriver at /opt/ibm/
tar -xzvf ibm_data_server_driver_package_linuxx64_v11.1.tar.gz
5- Change permission instalation script - /opt/ibm/dsddriver
chmod 755 installDSDriver
6- Run the installation script:
7- Download and install the driver using the pecl:
--- OR ---
tar -xzvf ibm_db2-2.0.8.tgz
cd ibm_db2
phpize
./configure
make
make install
----- You will see the following output -----
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 (Enter the path of dsdriver ):
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:
10- Reboot the Apache:
11- To Verify:
http://(ip-address)/info.php
----- DB2 user password expired -----
docker exec -it container-name bash
1- Check the user passwd details:
chage -l db2inst1
2- Change the user passwd:
passwd db2inst1
3- Update the user passwd in config.php file also:
vi /path/of/the/project/config.php
4- Reboot the Apache:
service apache2 restart