"Unexpected EOF from the server"

Nikhil <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hello all,
I am setting up freetds on an OS X Server (10.5.8) in order to use PHP to
connect to a SQL 2005 server. I have been moderately successful, and can
connect successfully using tsql. However, when I use PHP, I cannot connect
to my MSSQL server. When I try to connect, the freetds.log file shows:

*****************
12:27:38.122049 13379 (log.c:190):Starting log file for FreeTDS 0.82
on 2009-09-03 12:27:38 with debug flags 0xffff.
12:27:38.122112 13379 (iconv.c:363):iconv to convert client-side data to the
"ISO-8859-1" character set
12:27:38.122222 13379 (iconv.c:516):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
12:27:38.122260 13379 (iconv.c:516):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
12:27:38.122283 13379 (net.c:210):Connecting to 141.110.7.72 port 1433 (TDS
version 8.0)
12:27:38.122391 13379 (net.c:264):tds_open_socket: connect(2) returned
"Operation now in progress"
12:27:38.123094 13379 (net.c:303):tds_open_socket() succeeded
12:27:38.123123 13379 (util.c:162):Changed query state from DEAD to IDLE
12:27:38.123139 13379 (login.c:735):quietly sending TDS 7+ login packet
12:27:38.123256 13379 (token.c:312):tds_process_login_tokens()
12:27:38.124685 13379 (util.c:334):tdserror(0x102f283d0, 0x102f2f0b0, 20017,
0)
12:27:38.124726 13379 (dblib.c:7782):dbperror(0x100972200, 20017, 0)
12:27:38.124756 13379 (dblib.c:7835):20017: "Unexpected EOF from the server"
12:27:38.124772 13379 (dblib.c:7856):"Unexpected EOF from the server",
client returns 2 (INT_CANCEL)
12:27:38.124789 13379 (util.c:368):tdserror: client library returned
TDS_INT_CANCEL(2)
12:27:38.124803 13379 (util.c:389):tdserror: returning TDS_INT_CANCEL(2)
12:27:38.124865 13379 (util.c:162):Changed query state from IDLE to DEAD
12:27:38.124885 13379 (token.c:316):looking for login token, got  0()
12:27:38.124903 13379 (token.c:108):tds_process_default_tokens() marker is
0()
12:27:38.124917 13379 (token.c:111):leaving tds_process_default_tokens()
connection dead
12:27:38.124930 13379 (util.c:334):tdserror(0x102f283d0, 0x102f2f0b0, 20002,
0)
12:27:38.124945 13379 (dblib.c:7782):dbperror(0x100972200, 20002, 0)
12:27:38.124961 13379 (dblib.c:7835):20002: "Adaptive Server connection
failed"
12:27:38.124989 13379 (dblib.c:7856):"Adaptive Server connection failed",
client returns 2 (INT_CANCEL)
12:27:38.125003 13379 (util.c:368):tdserror: client library returned
TDS_INT_CANCEL(2)
12:27:38.125016 13379 (util.c:389):tdserror: returning TDS_INT_CANCEL(2)
12:27:38.125036 13379 (dblib.c:1372):dbclose(0x100972200)
12:27:38.125051 13379 (dblib.c:256):dblib_del_connection(0x102bd4b00,
0x102f2f0b0)
12:27:38.125209 13379 (mem.c:563):tds_free_all_results()
12:27:38.125237 13379 (dblib.c:303):dblib_release_tds_ctx(1)
12:27:38.125273 13379 (dblib.c:5727):dbfreebuf(0x100972200)
12:27:38.125372 13379 (dblib.c:718):dbloginfree(0x102f2ed50)

**********************

My freetds.conf file looks like this:

**********************
#   $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".

# Global settings are overridden by those in a database
# server specific section
[global]
        # TDS protocol version
tds version = 8.0

# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
dump file = /tmp/freetds.log
debug flags = 0xffff

# Command and connection timeouts
;timeout = 10
;connect timeout = 10
 # If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512

# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0

# A typical Microsoft server
[egServer70]
host = ntmachine.domain.com
port = 1433
tds version = 7.0

#AC501
[ac501]
host = ac-501.acad.tri-c.edu
port = 1433
tds version = 8.0

***********************


My PHP script look like this:

***********************

<?php

putenv("FREETDSCONF=/usr/local/php5/etc/freetds.conf");

$link = mssql_connect("ac501","sa","*hidden*") or die(error);

?>

*************************

Thank you,

Nikhil Chand
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.