pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: Douglas Douglas <replaceafi11@yahoo.es>
Cc: pgsql-php@postgresql.org
Subject: Re: pg_connect socket creation error (0x0000273F)
Date: Mon, 12 Jan 2004 16:07:34 -0700 (MST)
Message-ID: <Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com> (raw)
In-Reply-To: <20040112224607.26249.qmail@web80808.mail.yahoo.com>

On Mon, 12 Jan 2004, Douglas Douglas wrote:

> Hello.
> 
> I've been fighting with this all day, trying to fix it but I
> couldn't. So here I am. I have Cygwin installed in a Win XP machine.
> PostgreSQL is running there. Apache and PHP are installed in Windows
> in the same computer. PostgreSQL is properly configured (even psql
> and pgAdmin III work).
> 
> Since I've heard that sockets are more efficient that connecting to
> localhost, I decided to uncomment the lines:
> tcpip_socket = true 
> port = 5432
> in the postgresql.conf file.
> 
> But when I removed the host parameter from the connection string:
> pg_connect('dbname=mydb user=myuser password=mypass')
> 
> I got this message:
> Warning: pg_connect(): Unable to connect to PostgreSQL server: could
> not create socket: An address incompatible with the requested
> protocol was used. (0x0000273F) . in c:\htdocs\testsockets.php on
> line 2

I'm pretty sure you're confusing unix domain sockets with tcpip_sockets, 
which aren't the same thing.  By default, postgresql only answers on unix 
sockets, and tcpip has to be turned on.

PHP uses unix sockets if you DON'T express a host name in the connect 
string, but when you do, it switches to tcpip sockets.

So, your tcpip_socket = true turns on tcpip  while removing the host 
parameter from pg_connect makes it try to connect via local unix sockets.

I don't think cygwin supports local unix sockets, but don't quote me on 
that.

The performance difference is pretty small, if any, so don't worry too 
much about it, just find a config that works and you're gold.




view thread (2+ messages)

Message-ID: <Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: scott.marlowe@ihs.com, replaceafi11@yahoo.es
  Subject: Re: pg_connect socket creation error (0x0000273F)
  In-Reply-To: <Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com>
  References: <20040112224607.26249.qmail@web80808.mail.yahoo.com> <Pine.LNX.4.33.0401121604070.20581-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox