For our development needs, we try to implement a solution based on a DB2 (9.7.5) database (hosted on Windows 2003) and PHP (Windows too + Apache).
We try to use the PDO ODBC connection directly (with Host, port, etc...) and with the DSN way with no luck...
The db2cli executable works fine (we can query the DB).
We have an error like :
SQLSTATE[ ] SQLDriverConnect: -1393 IBMCLI Driver SQL10007N Message "0" could not be retrieved. Reason code: "6"
Has someone succeeded in connect such this way?
This topic has been locked.
2 replies Latest Post - 2012-11-06T16:40:01Z by SystemAdmin
Pinned topic DB2 for Windows, ODBC and PHP
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-11-06T16:40:01Z at 2012-11-06T16:40:01Z by SystemAdmin
nivanov1 100000H9H753 PostsACCEPTED ANSWER
Re: DB2 for Windows, ODBC and PHP2012-11-02T21:22:00Z in response to SystemAdmin> SQL10007N Message "0" could not be retrieved. Reason code: "6"
This usually indicates some sort of an environment misconfiguration.
Are you using the latest pdo_ibm driver?
SystemAdmin 110000D4XK5837 PostsACCEPTED ANSWER
Re: DB2 for Windows, ODBC and PHP2012-11-06T16:40:01Z in response to nivanov1I don't use the pdo_ibm driver. I use the pdo_odbc driver.
I first tried the pdo_ibm but never suceeded in making it working (I compiled successfully the source with my version of php under windows, started apache successfully without errors - I think the error message is the same for that driver).
So, I hoped that as ODBC is the 'standard' and multi-DB it could work at first use... no way
I'm investigating into Zend framework but I know it uses db2connect and not PDO which is not convenient for me.
I will try a Linux DB2 install too (as I think it's an access right problem and as windows and linux are different on that point) which can be a successful solution for me.
So, if you have another idea...