Skip to Content.
Sympa Menu

freetds - Re: PHP, FreeTDS & Microsoft SQL Server 7, best methods?

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: PHP, FreeTDS & Microsoft SQL Server 7, best methods?
  • Date: Fri, 3 Sep 1999 08:58:58 -0400 (EDT)




On Fri, 3 Sep 1999, Karl Pielorz wrote:

> Hi All,
>
> I'll freely confess I don't know too much about FreeTDS and the way bits of
> it
> interact with PHP, to ultimately connect us to our Microsoft SQL Server 7.
>
> At the moment, we compile up FreeTDS, then compile up PHP with the option,
>
> "--with-sybase=/usr/local/include/freetds"
>
--with-sybase will link with dblib, you may also try --with-sybase-ct (I
think) which is ctlib. I have not personally spent much time on it, but
much more activity has gone into ctlib as of late than dblib, so it may be
working better. Also what version of PHP are you using, we've had reports
of the 4.0betas having problems (which is on the todo list).

> This builds, and works fine with Apache (We did have a problem with
> name-space
> clashes on dbopen() - but we've worked round that).
>
ctlib will also avoid the name-space clash

> Obviously FreeTDS is alpha/beta, and I gather theres many parts to it as
> well?
> (CTLib? DBLib?) - I've tried reading through the doc's, but I'll also admit
> I'm pushed for time...
>
Yes, it's very beta at the moment, but we've made some good progress
lately. What version of FreeTDS are you using? It may be wise to grab a
recent snapshot.

> The problem we're seeing at the moment, is despite the use of using
> persistant
> connections in our PHP/http pages, e.g. "sybase_pconnect()" - the machine
> running PHP/Apache quickly seems to eat up all the connections available to
> our Microsoft SQL Server (10 in total).
>
I'm not sure what mechanism PHP uses to cache connections, but I do know
that the dblib modules under PHP 3.0.x are somewhat of a mess. It looks
like they been worked on under 4.0.

> I've tried limiting the number of children Apache can have to only 3, this
> has
> helped a little - but it still runs out of connections.
>
> When this happens, the apache error log just logs "DB-Library: Login
> incorrect."
>
> So, is there,
>
> a) Any way of fixing this?
>
> b) Are we using the best/most stable way of connecting PHP to a Microsoft
> SQL
> 7 server? - I'm looking to replace FreeTDS, but due to my lack of
> understanding of it's components, are we using the best ones?
>
The other method would depend on which platform you are on, if you are on
Linux on x86, Sybase has libraries available, although there are some
issues getting them to work in glibc (I think this is still the case) but
it can be done. Since Sybase and MS SQL Servers were once a single code
base this will work. If OTOH you have a non-x86 plaform or are running a
BSD flavor (do the sybase libs work through lxrun on BSD?) FreeTDS may be
your only choice.

I will test PHP persistant connects this weekend and see what I can find.
Version information and a PHP script that replicates the problem would be
most helpful.

Cheers,

Brian

> Thanks in advance,
>
> -Karl
>





Archive powered by MHonArc 2.6.24.

Top of Page