views:

401

answers:

2

I have MSSQL running on a Windows server. I can connect to it using ODBTP, ADODB and PHP from other windows servers. When I try the same thing on a Linux server, I get a response error: [ODBTPERR][0]Invalid Response in /var/www/html/Database/adodb5/drivers/adodb-mssql.inc.php on line 726:[ODBTPERR][0]Invalid Response
The ODBTP (v1.1.4) is enabled as an extension on the Linux server, and if I play with the odbtp.conf file settings I get proper connection errors, so it is picking things up correctly. I can telnet from the Linux server to the database server on port 2799 and get back an OBDTP prompt. Can anyone suggest any steps? Thanks

A: 

The problem was caused by trying to use odbtp libraries and php extension that were not compiled for a 64bit machine. This clue came from a Robert Twitty posting on a forum (not sure where). We recompiled the libodbtp.so and odbtp.so enabled for 64 bits. The solution was found by Dave Keen ([email protected]).

Adrian Raper
A: 

I had similar problem: PHP Warning: [ODBTPERR][0]Invalid Response in /var/projects/myproject/tmptest.php on line 16

And I also solved it by recompiling odbtp. Here are detailed instructions from README.64bitOS file found in odbtp source directory (odbtp-1.1.4)

Building ODBTP client library on a 64-bit OS

On 64-bit operating systems, suzh as Tru64 UNIX, the C intrinsic data type "long" is 64 bits. However, the ODBTP client library assumes that the "long" data type is 32 bits. If the client library is built on a 64-bit system using the "out of the box" configuration, then "Invalid Response" errors will occur during client application runtime. To prevent these errors from occuring, _C_LONG_64_ must be defined prior to compiling the library. This is doen by simply uncommenting the line in the file odbtp.h that defines this symbol

Instructions:

  1. Open the file odbtp.h in a plain text editor, such as vi.

  2. Find the line containing the _C_LONG_64_ definition that has been "commented out".

    /* #define _C_LONG_64_ 1 */

  3. Uncomment the line by removing the /* and */.

    #define _C_LONG_64_ 1

  4. Exit the editor, and then build the client library according to the installation instructions.


I am not sure if this solution would work with static ODBTP extension... I have implemented it using dynamic extension (http://odbtp.sourceforge.net/install.html#phpshared)

Max Zalota