As I wrote, setting up the Connectors was packed with disapointments.
Nearly nothing was going smoothly.
Starting with DB2
To install the ibm_db2 and pdo_ibm php extensions:
export IBM_DB_HOME=/<path>db2inst1/sqllib
pecl install ibm_db2
pecl install pdo_ibm
phpize --clean
phpize
./configure
make
make install
./configure --with-PDO_IBM=DB2HOME
In your PHP.INI (/etc/php/<version>/apache2)
Make sure you have
ibm_db2.instance_name=db2inst1
extension=pdo.so
extension=ibm_db2.so
extension=pdo_ibm.so
Restart Apache with sudo systemctl restart apache2
Check you Environment Variables
echo $LD_LIBRARY_PATH, if that fails, add that to .bashrc
nano .bashrc
export LD_LIBRRARY_PATH=/<path>db2inst1/sqllib
Find and install the IBM Datamanagement Console
Check the Services Ports in /etc/services
IBM Changed them, but the Console connects on 50000
# Local services
DB2_db2inst1 60000/tcp
DB2_db2inst1_1 60001/tcp
DB2_db2inst1_2 60002/tcp
DB2_db2inst1_3 60003/tcp
DB2_db2inst1_4 60004/tcp
DB2_db2inst1_END 60005/tcp
db2c_db2inst1 50000/tcp #<== This Dude
DB2_db2inst2 20000/tcp
DB2_db2inst2_1 20001/tcp
DB2_db2inst2_2 20002/tcp
DB2_db2inst2_3 20003/tcp
DB2_db2inst2_4 20004/tcp
DB2_db2inst2_END 20005/tcp
db2c_db2inst2 25000/tcp
Data Management Console
Adjust Path and Name as needed, configure at first run
sudo ./Downloads/Software/DB2/ibm-db2-data-management-console-3.1.12/ibm-db2-data-management-console --no-sandbox
Once started
Open in your Browser
http://localhost:11080/console
ODBC install can be found here
and more (1)
and more (2)
A little outdated Info, but might help in case of Problems.
On the MariaDB side
Just search for MariaDB Connectors and install. I run into a Problem where the Package for UBUNTU didn't contain the actual Driver.
I Installed the RedHat instead and that worked fine.
My /etc/odbc.ini
[DEFAULT]
Driver = IBM DB2 ODBC DRIVER
[SAMPLE]
DESCRIPTION = Connection to Db2
DRIVER = Db2
[MariaDB]
DESCRIPTION = Connection to MariaDB
DRIVER = MariaDB
My /etc/odbcinst.ini
[IBM DB2 ODBC DRIVER]
Description = Db2 Driver
Driver=/dbdata/db2inst2/sqllib/lib/libdb2o.so
fileusage=1
dontdlclose=1
[MariaDB]
Description = MariaDN Driver
;Driver = /home/martin/db2_cli_odbc_driver/odbc_cli/clidriver/lib/libdb2o.so
Driver=/usr/lib64/libmaodbc.so
[SAMPLE]
Description = Db2 Driver
Driver = /home/martin/db2_cli_odbc_driver/odbc_cli/clidriver/lib/libdb2o.so
fileusage=1
dontdlclose=1
The *2o.so indicate a 64Bit Driver. Some examples still point to the 32Bit ones.