Skip to Content.
Sympa Menu

freetds - Re: via PHP to Microsoft SQL Server V7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT umcc.ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: via PHP to Microsoft SQL Server V7.0
  • Date: Mon, 17 Jan 2000 22:35:58 -0500 (EST)




On Tue, 18 Jan 2000, James Cameron wrote:

> Well, I've got a connection going out, but the other end drops it.
> Any ideas for the possible causes? Can the TDS protocol be echoed by a
> TCP relay? Or does it contain the IP address of the client?
>
Yes it can, I use a similar setup for debugging. You can also define a
environment var call TDSDUMP that will create a log file (ie export
TDSDUMP=/tmp/freetds.log). That should help debug things.

> (Note: I do not administer the other end, and I am doing this access
> without specific permission. I do have the ability to access their
> database via a client they provide, but it only runs on Microsoft
> Windows so I end up using a remote window session to get at it. My task
> is to provide a platform independent web interface to the data on the
> server.)
>
> Configuration: nestor is a 486/100 running the php3 and freetds code.
> idda is a relaying host, accepting connections on port 1433 and
> transferring them to the actual Microsoft SQL Server over a tunnel
> running on 56k modem.
>
using slirp by chance? I'm using it currently without problem.

> When the php script runs, it stalls within the sybase_connect() while
> the connection is made. However the connection is closed by the server,
> and the message "Unknown marker: 0!!" is displayed. The php script
> stalls at this point. Attaching gdb to the process shows the following
> stack trace;
>
When MS SQL closes the connection after the login packet, it generally
means it thinks the packet is mangled...Did you configure using
--with-tdsver=4.2 ? It would probably close when presented with a 5.0
packet. (In case you don't understand this...TDS comes in a few different
flavors...the ones we support are 4.2 (Sybase and MS), 5.0 (Sybase only),
and 7.0 (MS SQL only 7.0+). The default is 5.0, so when connecting to MS
SQL you need to 1) configure --with-tdsver=4.2 2) export TDSVER=42 3) set
it in place of the 'ether' thing in interfaces file (CVS version only) or
4) explictly set it in the code... Since you are using PHP options 1-3
are available to you (I reccomend option 1).

> The interfaces file points at idda, which is 10.0.0.4
>
> # cat $SYBASE/interfaces
> giskard
> query tcp ether 10.0.0.4 1433
> master tcp ether 10.0.0.4 1433
>
> Does the name in the interfaces file have to match the name the server
> believes it to be?
No, it only cares about the IP/port. The name is arbitrary

>
> --
> James Cameron (cameron AT stl.dec.com)
>

Brian





Archive powered by MHonArc 2.6.24.

Top of Page