Skip to Content.
Sympa Menu

freetds - RE: [freetds] connection Linux -> MsSQL-2000 server works than does notwork anymore.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] connection Linux -> MsSQL-2000 server works than does notwork anymore.
  • Date: Mon, 19 Jan 2004 16:48:41 +0100

>
> Linux 2.4.19 (SuSE-8.1)
>
> Freetds:
>
> ./configure --prefix=/usr/local --with-tdsver=8.0 --enable-msdblib
>

Version ?? I hope 0.62.

> Apache - httpd-2.0.48:
>
> ./configure --prefix=/www --enable-so --enable-module=all
> --enable-mods-shared=all
>
> PHP-4.3.4:
>
> ./configure --with-apx2=/www/bin/apxs
> --with-config-file-path=/www/conf
> --with-mssql=/usr/local --enable-trans-sid --enable-sigchild
> --enable-msdblib
>
> The MsSQL server uses port 1533 (not default 1433)
>
> Till last friday. Everything worked well.
>

So you updated FreeTDS from a former version... which one?

> Only problem /usr/local/etc/freetds.conf seemed to be there
> for decoration. I tried to change lines in it like port =
> 1533 in [GLOBAL] without success. Thus I had to type export
> TDSVER=8.0 and export TDSPORT=1533.
>
> tsql -S 192.168.x.x -U MyAccount
>

Try setting TDSDUMPCONFIG (see UserGuide) and connect using freetds.conf
server.

> No problem I had 1>
>
> To connect, PHP script:
>
> <?php
>
> $myServer = "192.168.x.x";
> $myUser = "abarthel";
> $myPass = "xxxxxxxx";
> $myDb = "dBase";
>
> $conn = @mssql_connect($myServer, $myUser, $myPass) //// worked OK
> or die ("Could not connect to $dBase");
>
> $s = $mssql_select_db($myDb, $conn)
> or die ("Could not open dbase $myBd"); ///// worked OK
>
> $query = "select ....";
>
> $resultat = mssql_query($query); //// result OK
>
> Thus there was no problem.
>
> Today with the same configuration I have:
> Could not connect to dBase
>
> But the tsql command still works. Thus connection to MsSQL
> server is done.
>
> Only through a PHP script I can not connect.
>
> I suspect a slowness of the MsSQL server to respond or to,
> acknowledge. Thus I
> suppose I have to repeat the connection request a certain
> number of time
> before success.
>
> My questions:
>
> 1) How to activate the freetds.conf script?
> 2) What could be the problem (tsql works but PHP
> mssql_connect() not)?

Using tsql you override using TDSVER/TDSPORT environment however PHP is
still using default port 1433.

> 3) How to configure a repeatable connection request
> (something like connect
> timeout=10 (or longer time))?
>

See timeout configurations in UserGuide. There is also an issue related
to textlimit configuration in PHP. Do not use this option. FreeTDS do
not support setting this limit and PHP fails connecting (leaking also
resources).

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page