php - connecting to db2 through pdo_ibm module manually configured error SQL10007N -5005 -
i having difficulties connect remote db2 database using pdo_ibm, followed instructions on ibm configure pdo_ibm library , linux client since php not configured manually installed through apt-get not sure if current error might due missconfiguration or else.
my stage is: linux debian wheezy ibm db2 client 10.5 php 5.4.45 pdo_ibm 1.4
when try connect db2 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 following error
object(pdoexception)[2] protected 'message' => string 'sqlstate= , sqldriverconnect: -5005 [ibm][cli driver] sql10007n message "0" not 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
network/firewall check can connect through squirrel client, has faced same problem?
have tried alternative way provided here
the following example shows pdo_ibm dsn connecting db2 database cataloged db2_maximo in db2cli.ini:
$db = new pdo("ibm:dsn=db2_maximo", "", ""); [db2_maximo] database=sample protocol=tcpip port=50002 hostname=my-db2-machine uid=my-os-user pwd=my-os-password
Comments
Post a Comment