I am having difficulty connecting to a remote db2 database using pdo_ibm, I followed the instructions for IBM to configure the pdo_ibm library and linux client, but since my php is not manually configured, but installed via apt-get, I'm not sure if the error may be connected to a configuration mod or anything else.
My scene: Linux debian wheezy ibm client db2 10.5 php 5.4.45 pdo_ibm 1.4
when I try to connect to db2 with the following code:
<?php $usernameMaximo = '@user'; $passwordMaximo = '@password'; $connectionStringMaximo = 'ibm:DRIVER={IBM DB2 ODBC DRIVER}; DATABASE=@databaseName ; HOSTNAME=@xx.xxx.xxx.xx ;PORT=50002;PROTOCOL=TCPIP;'; try { $connection = new PDO($connectionStringMaximo, $usernameMaximo, $passwordMaximo, array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION) ); echo "Success"; } catch (Exception $e) { var_dump($e); }
I get the following error
object(PDOException)[2] protected 'message' => string 'SQLSTATE= , SQLDriverConnect: -5005 [IBM][CLI Driver] SQL10007N Message "0" could not be retrieved. Reason code: "3". ' (length=123) private 'string' (Exception) => string '' (length=0) protected 'code' => int 0 protected 'file' => string '/apps/html/tests/pdo_db2.php' (length=28) protected 'line' => int 8 private 'trace' (Exception) => array (size=1) 0 => array (size=6) 'file' => string '/apps/html/tests/pdo_db2.php' (length=28) 'line' => int 8 'function' => string '__construct' (length=11) 'class' => string 'PDO' (length=3) 'type' => string '->' (length=2) 'args' => array (size=4) ... private 'previous' (Exception) => null public 'errorInfo' => null
the network / firewall is already checked, so I can connect through the protein client, did someone have the same problem?
source share