Hi
We have a problem using the PHP unified ODBC function odbc_connect() to access a remote database :
We have a server running a DB2 UDB database for Linux
We are attempting to access this database from an application server that is running PHP and Apache on Linux. On this server we have installed DB2 Connect and the DB2 Application Development Client.
On the application server we have catalogued the remote database as follows:
Database Directory
Database alias = WEBPRD01
Database name = WEBPRD01
Node name = MYBBB01
Database release level = 9.00
Directory entry type = Remote
Catalog node number = -1
Node Directory
Node Name = MYBBB01
Protocol = TCPIP
Hostname = mybbb01.mybbb.co.uk
Service Name = 3700
From the command line we are able to connect to the database server successfully and issue an SQL select statement.
However, when we try to access the remote database server via the following PHP script we get the following error:
Warning: odbc_connect(): SQL error:, SQL State $ in SQl Connect
PHP Script
<?php
$dsn = "WEBPRD01";
$user = "***";
$password = "****";
$conn = odbc_connect($dsn,$user,$password);
?>
We have compiled PHP with the appropriate "--with-ibm-db2=/home/db2inst1/sqllib" configuration parameter.
It seems as though the problem revolves around the PHP unified ODBC function odbc_connect() and its ability to connect to a remote database.
Could anybody give us any clues as to what might be the problem ?
Many Thanks in advance for any help you can offer
Software Versions
Application Server
Linux: Red Hat 7.3
Apache: 1.3.29
PHP: 4.3.9
DB2 Connect : DB2 Connect Personal Edition 7.2
Database Server
Linux: Red Hat 7.3
DB2 : DB2 7.1 Fixpack 7 (DB2 v7.1.0.68)