Topic
  • 2 replies
  • Latest Post - ‏2012-11-06T16:40:01Z by SystemAdmin
SystemAdmin
SystemAdmin
5837 Posts

Pinned topic DB2 for Windows, ODBC and PHP

‏2012-11-02T14:56:43Z |
Hi,
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?
Many thanks!
Updated on 2012-11-06T16:40:01Z at 2012-11-06T16:40:01Z by SystemAdmin
  • nivanov1
    nivanov1
    53 Posts

    Re: DB2 for Windows, ODBC and PHP

    ‏2012-11-02T21:22:00Z  
    > 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?

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.dbclient.php.doc/doc/c0021523.html
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: DB2 for Windows, ODBC and PHP

    ‏2012-11-06T16:40:01Z  
    • nivanov1
    • ‏2012-11-02T21:22:00Z
    > 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?

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.dbclient.php.doc/doc/c0021523.html
    I 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...