pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_connect socket creation error (0x0000273F)
2+ messages / 2 participants
[nested] [flat]

* pg_connect socket creation error (0x0000273F)
@ 2004-01-12 22:46  Douglas Douglas <replaceafi11@yahoo.es>
  0 siblings, 1 reply; 2+ messages in thread

From: Douglas Douglas @ 2004-01-12 22:46 UTC (permalink / raw)
  To: pgsql-php

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

What does this line "An address incompatible with the requested
protocol was used." means?!?

I've looked similar errors in this list and google but I couldn't
find an answer. Some people wrote that could be a problem in the
pg_hba.file. I tried there too, but didn't work:
host all all 127.0.0.1 255.255.255.255 trust

I would appreciate any help. Thanks.
Regards, Douglas.

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_connect socket creation error (0x0000273F)
@ 2004-01-12 23:07  scott.marlowe <scott.marlowe@ihs.com>
  parent: Douglas Douglas <replaceafi11@yahoo.es>
  0 siblings, 0 replies; 2+ messages in thread

From: scott.marlowe @ 2004-01-12 23:07 UTC (permalink / raw)
  To: Douglas Douglas <replaceafi11@yahoo.es>; +Cc: pgsql-php

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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-01-12 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-12 22:46 pg_connect socket creation error (0x0000273F) Douglas Douglas <replaceafi11@yahoo.es>
2004-01-12 23:07 ` scott.marlowe <scott.marlowe@ihs.com>

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