Skip to Content.
Sympa Menu

freetds - Re: [freetds] PHP 5.2.6 + pdo_dblib + FreeTDS 0.64 -- tds_open_socket: Unknown error: 0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Kian Mohageri" <kian.mohageri AT gmail.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] PHP 5.2.6 + pdo_dblib + FreeTDS 0.64 -- tds_open_socket: Unknown error: 0
  • Date: Thu, 24 Jul 2008 14:34:13 -0700

On Thu, Jul 24, 2008 at 11:23 AM, James K. Lowden <jklowden AT freetds.org>
wrote:
> connect(2) may return only 0 or -1, and should set errno. It appears to
> be returning nonzero, but not setting errno. (sock_errno is just errno
> except on Win32.) That is, it reports failure but not why.
>
> The only conclusion I can draw is that your FreeTDS configuration is
> correct, but something is amiss with your network setup that prevents your
> PHP application from forming the connection. Moreover, IMO you have a
> FreeBSD bug, because a non-zero return code from connect(2) must be
> accompanied by a valid errno value.
>

I went ahead and looked into it some more and used your existing
debugging code. connect(2) is returning -1 but not setting errno, as
you said. I also checked that errno wasn't set to 0 explicitly (even
though if I'm understanding correctly, that'd still be broken
behavior). I've submitted a PR with FreeBSD. Still not sure why the
connect is failing in the first place, but hopefully it's not
something I've screwed up on my part. I find it really strange that
it works in Apache but not CLI.

Time will tell.

Thanks for your help,

-Kian




Archive powered by MHonArc 2.6.24.

Top of Page