I have tried to connect to DB2/AS400 remote database with db2cli odbc module and odbc_connect but returns the next error:
Execution failed: [unixODBC][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: "10.10.100.5". Communication function detecting the error: "recv". Protocol specific error code(s): "", "", "0". SQLSTATE=08001
This is my PHP code:
<?php
$database = 'xxxx';
$user = 'xxxx';
$password = 'xxxx';
$hostname = '10.10.100.5';
$port = '55000';
$driver = 'DB2';
$conn_string = "DRIVER={$driver};DATABASE=$database;HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;";
if (!$db = odbc_connect ($conn_string, $user, $password)) {
print("Execution failed:\n");
}
else echo 'Success!';
odbc_close($db);
Help me please!!