Skip to Content.
Sympa Menu

freetds - [freetds] Re: Connection issue

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT t-online.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Re: Connection issue
  • Date: Tue, 14 Jun 2005 11:22:43 +0200


On Jun 14, 2005, at 8:31, Chris parent wrote:

Why is it that tsql command line runs fine but not my
web PHP version? It's almost as if that the PHP
version doesnt know where or how to find my
freetds.conf file.

That's likely your problem. Make sure the user account the web server runs as can access and read your freetds.conf file. That usually means read rights for other on the freetds.conf file and at least execute rights on all of its parent directories.

Turning on FreeTDS's logging facilities via the TDSDUMPCONFIG environment variable might also help, but it's not exactly straightforward to set that in time in a web server environment.

Since you say you can also make it fail on the command line, you could try:
TDSDUMPCONFIG=stdout php test.php

Another likely scenario is that you have multiple copies of FreeTDS on your computer and PHP's mssql extension picked up the wrong one, one which expects the freetds.conf file in another place.

On Linux, you can print shared library dependencies with ldd.
For example, if you compiled php's mssql extension as shared:
ldd /usr/local/lib/php/extensions/no-debug-non-zts-20040412/mssql.so
Or if it's built-in:
ldd /usr/local/bin/php

On Mac OS X, you'd have to substitute ldd with otool -L

--
fds




Archive powered by MHonArc 2.6.24.

Top of Page