freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
RE: [freetds] Re: connecting to remote MS Sql 2k server from linux PHP
- From: "Rick D. Conner" <rick AT wedosites.com>
- To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
- Subject: RE: [freetds] Re: connecting to remote MS Sql 2k server from linux PHP
- Date: Fri, 29 Oct 2004 00:00:57 -0400
Thanks for the response...
Ok to start off, it is running under apache, not the command line.
/home/bwelch/.freetds.conf
=========================================
[global]
# TDS protocol version
tds version = 4.2
; initial block size = 512
# uses some fixes required for some bugged MSSQL 7.0 server that
# return invalid data to big endian clients
# NOTE TDS version 7.0 or 8.0 should be used instead
; swap broken dates = no
; swap broken money = no
# Database server login method, if both server and domain
# logins are enabled, domain login is tried first if a domain
# is specified, and if that fails the server login will be used.
# OBSOLETE
; try server login = yes
; try domain login = no
# The default authentication domain, can be overridden by
# specifying a username with a domain prefix, e.g. DOMAIN\username
# OBSOLETE use DOMAIN\username as username
; nt domain = WORKGROUP
# If the server responds with different domain try that one?
# OBSOLETE never been used
; cross domain login = no
# 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 level = 10
# 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.
# (Microsoft servers sometimes pretend TEXT columns are
# 4 GB wide!) If you have this problem, try setting
# 'text size' to a more reasonable limit
text size = 64512
# This is a Sybase hosted database server, if you are directly on the
# net you can use it to test.
[JDBC]
host = 192.138.151.39
port = 4444
tds version = 5.0
# The same server, using TDS 4.2. Used in configuration examples for the
# pool server, since the pool server supports only TDS 4.2.
[JDBC_42]
host = 192.138.151.39
port = 4444
tds version = 4.2
# The client connecting to the pool server will use this to find its
# listening socket. This entry assumes that the client is on the same
# system as the pool server.
[mypool]
host = 127.0.0.1
port = 5000
tds version = 4.2
# A typical Microsoft SQL Server 2000 configuration
[MyServer2k]
host = 66.208.184.170
port = 1433
tds version = 4.2
dump file = /home/bwelch/public_html/test/tds.log.txt
==========================================
I have noticed also that it "sees" the MyServer2k entry, but doesn't seem to
use it. I'm all confused :(
Rick D. Conner
Rick AT WeDoSites.com
http://www.wedosites.com
-----Original Message-----
From: Daniel Fazekas [mailto:fdsubs AT axelero.hu]
Sent: Thursday, October 28, 2004 7:14 PM
To: FreeTDS Development Group
Subject: [freetds] Re: connecting to remote MS Sql 2k server from linux PHP
On Oct 28, 2004, at 18:31, Rick D. Conner wrote:
At first sight I guessed this would be a file access rights problem
(the user PHP runs as doesn't have sufficient rights to read the config
file), but I'm not that sure anymore. In fact, it's probably something
else.
Several things look a bit weird to me.
First off, are you trying to use the php script via a web server, such
as Apache, or is it getting run via the command-line PHP interpreter?
It seems to be the latter. That's good, it makes it all simpler.
The weird bits:
The putenvs at the start of your script should already be too late in
the process to set them - maybe not, since you aren't running through a
web server -, yet the log files are obviously getting made and the
FREETDSCONF parameter is also seen as set.
Set wrongly, I might add, as it is supposed to be a file name, not the
name of a directory, according to the manual:
<http://www.freetds.org/userguide/envvar.htm>
Anyway, $HOME/.freetds.conf, $SYBASE/freetds.conf or {compile-time
freetds prefix}/etc/freetds.conf would get processed automatically
without setting any environment variables.
Further weirdness: according to the log, FreeTDS seems to find the
myserver2k entry in /home/bwelch/.freetds.conf anyway - but it ignores
it and doesn't seem to be looking for it, instead trying to find the
default SYBASE entry.
Then, despite all this, at the end it tries to connect to the mssql
default port 1433 even though the default should be sybase's port 5000
considering it failed to get anything useful from the config files.
So I have to conclude I'm a bit confused but the FreeTDS developers
will probably know the explanation right away. :)
In the meantime you should post the contents of all your
FreeTDS-related configuration files.
/home/bwelch/.freetds.conf and /usr/local/freetds/etc/freetds.conf
--
fds
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
-
[freetds] connecting to remote MS Sql 2k server from linux PHP,
Rick D. Conner, 10/28/2004
-
[freetds] Re: connecting to remote MS Sql 2k server from linux PHP,
Daniel Fazekas, 10/28/2004
- RE: [freetds] Re: connecting to remote MS Sql 2k server from linux PHP, Rick D. Conner, 10/29/2004
- Re: [freetds] Re: connecting to remote MS Sql 2k server from linux PHP, James K. Lowden, 10/29/2004
-
[freetds] Re: connecting to remote MS Sql 2k server from linux PHP,
Daniel Fazekas, 10/28/2004
Archive powered by MHonArc 2.6.24.