I am trying to setup an Ubuntu VM as a php test development server.
However, I am having trouble connecting to our Remote Database with db2.
I am new to Ubuntu/configuring db2 and have been following this guide (the first comment):
https://www.php.net/manual/en/ibm-db2.installation.php
I am able to run the db2_connect()
function in php however I get this response:
ERROR: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "127.0.0.1". Communication function detecting the error: "connect". Protocol specific error code(s): "111", "*", "*". SQLSTATE=08001 SQLCODE=-30081
I have searched up the error code, and 111
stands for Access denied
but I am not convinced the driver is even communicating with the DB because I can type in any random assortment of IP addresses/host names and I still get the same error.
From my Ubuntu VM I can ping the DB, and the Firewall is set so that all connections are allowed from the Ubuntu VM to the DB and vice versa - another reason I am unconvinced the Ubuntu VM is even communicating with the DB
I have configured the db2cli.ini
and db2dsdriver.ini
to the best of my ability and will gladly on request post those files for further inspection but atm I'd like to keep the post short and to the point.
I am running Ubuntu 22.04.2 LTS
, running PHP8.2
and installed the DB2 v11.5.8 Data Server Driver Package
Some troubleshooting tips/pointers in the right direction would be incredibly helpful.
I was previously following this guide:
https://fractio.nl/2007/10/26/setting-up-unixodbc-with-a-remote-db2/
But after receiving random errors such as is the driver working?
I did my best to remove it and try again with the php.net
link