I have odbtp installed and everything seems to be working ok except when I test i get,
[ODBTPERR][0]Unable to read from server (Success)
My script is:
<?php
$connection = odbtp_sconnect(
'<MY SERVER IP>:<MY SERVER PORT>',
'DRIVER={SQL Server};SERVER=<MY SERVER IP>;UID=<MY SERVER USER>;PWD=<MY SERVER password>;DATABASE=<MY DATABASE NAME>;'
)
or
die("died" . odbtp_last_error());
The output of the script is "died[ODBTPERR][0]Unable to read from server (Success)"
I can connect to the database using:
tsql -H <MY SERVER IP> -p <MY SERVER PORT> -U <MY SERVER USER> -P <MY SERVER password>
at the command line, and query the database as expected.
Background:
I am currently migrating servers and setting up PHP etc on a new server. I was told that it required MSSQL access and compilied with the MSSQL. Then found that they actually need odbtp enabled and the odbtp_* functions are used throughout the scripts.
I have mssql enabled / compliled in PHP (the non odbtp ones and they work). And have tried to add the odbtp ones, using the shared method described (I have compiled and moved the php_odbtp.so). And it now appears in phpinfo (show below). However everytime I try to connect I get the described error.
odbtp
ODBTP (Open Database Transport Protocol) Support enabled
ODBTP Library Version 1.1.4
Directive Local Value Master Value
odbtp.datetime_format object object
odbtp.detach_default_queries Off Off
odbtp.guid_format string string
odbtp.interface_file /usr/local/share/odbtp.conf /usr/local/share/odbtp.conf
odbtp.truncation_errors On On
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-10-15
More info:
Top of 'Makefile' used to create php_odbtp.so.
#
# Module specific variables
#
MODULE=php_odbtp.so
MODULE_OBJS=php_odbtp.o odbtp.o sockutil.o
MODULE_CFLAGS=-DHAVE_ODBTP -DCOMPILE_DL_ODBTP
# Uncomment the below line and comment the above line to include MSSQL support
#MODULE_CFLAGS=-DHAVE_ODBTP -DCOMPILE_DL_ODBTP -DODBTP_MSSQL
MODULE_INCLUDES=-I../.. -I./odbtp
Just to show i've not put in the mssql functions bit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wonder if anyone can help,
I have odbtp installed and everything seems to be working ok except when I test i get,
[ODBTPERR][0]Unable to read from server (Success)
My script is:
<?php
$connection = odbtp_sconnect(
'<MY SERVER IP>:<MY SERVER PORT>',
'DRIVER={SQL Server};SERVER=<MY SERVER IP>;UID=<MY SERVER USER>;PWD=<MY SERVER password>;DATABASE=<MY DATABASE NAME>;'
)
or
die("died" . odbtp_last_error());
$test_query = "SELECT * FROM <MY Table>";
$result = odbtp_query($test_query);
while($row = odbtp_fetch_assoc($result))
{
var_dump($row);
}
?>
I have also tried odbtp_connect.
The output of the script is "died[ODBTPERR][0]Unable to read from server (Success)"
I can connect to the database using:
tsql -H <MY SERVER IP> -p <MY SERVER PORT> -U <MY SERVER USER> -P <MY SERVER password>
at the command line, and query the database as expected.
Background:
I am currently migrating servers and setting up PHP etc on a new server. I was told that it required MSSQL access and compilied with the MSSQL. Then found that they actually need odbtp enabled and the odbtp_* functions are used throughout the scripts.
I have mssql enabled / compliled in PHP (the non odbtp ones and they work). And have tried to add the odbtp ones, using the shared method described (I have compiled and moved the php_odbtp.so). And it now appears in phpinfo (show below). However everytime I try to connect I get the described error.
odbtp
ODBTP (Open Database Transport Protocol) Support enabled
ODBTP Library Version 1.1.4
Directive Local Value Master Value
odbtp.datetime_format object object
odbtp.detach_default_queries Off Off
odbtp.guid_format string string
odbtp.interface_file /usr/local/share/odbtp.conf /usr/local/share/odbtp.conf
odbtp.truncation_errors On On
Thanks in advance.
More info:
Top of 'Makefile' used to create php_odbtp.so.
#
# Module specific variables
#
MODULE=php_odbtp.so
MODULE_OBJS=php_odbtp.o odbtp.o sockutil.o
MODULE_CFLAGS=-DHAVE_ODBTP -DCOMPILE_DL_ODBTP
# Uncomment the below line and comment the above line to include MSSQL support
#MODULE_CFLAGS=-DHAVE_ODBTP -DCOMPILE_DL_ODBTP -DODBTP_MSSQL
MODULE_INCLUDES=-I../.. -I./odbtp
Just to show i've not put in the mssql functions bit.
Is this happening just for this query? As a test, can you run this same query on the ODBTP server's host machine using the odbtpcli.exe program?
-- bob