pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem connecting with PHP in OS X
2+ messages / 2 participants
[nested] [flat]
* Problem connecting with PHP in OS X
@ 2003-03-08 14:54 Eric Marsh <emarsh@mac.com>
2003-03-08 16:17 ` Re: Problem connecting with PHP in OS X Antti Haapala <antti.haapala@iki.fi>
0 siblings, 1 reply; 2+ messages in thread
From: Eric Marsh @ 2003-03-08 14:54 UTC (permalink / raw)
To: pgsql-admin
Good Morning,
I've got a J2EE program I've been working on for some time that has
been connected to a FrontBase DBMS. Well as a result of my spending
some time exploring the open source world I've decided to to change
database to PostgreSQL.
I'm developing on Mac OS X and found a page on the Apple website
describing how to set up PostgreSQL and then how to connect to it. I
built and installed PostgreSQL and performed a couple simple operations
to confirm that its working properly.
Next, to simplify administration I followed the instructions to install
PHP and phpPgAdmin. Using the simple example script I was able to
connect to the database with PHP. When I tried to use phpPgAdmin I was
getting fail to login errors. Poking around the PHP code I discovered
that if I commented out a line that added "host=localhost" I was able
to connect.
Since the instructions I'm working off uses PHP 2.4.2 and PostgreSQL
7.2 and I'm using PHP 2.4.2 and PostgreSQL 7.3 I figured that the
different version of PostgreSQL gives me a good place to start looking
and as such I'm posting to this list rather than the PHP list.
Does anyone have any idea why host=localhost is breaking my connection?
Is there a configuration value I should be setting?
Thanks,
Eric Marsh
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Problem connecting with PHP in OS X
2003-03-08 14:54 Problem connecting with PHP in OS X Eric Marsh <emarsh@mac.com>
@ 2003-03-08 16:17 ` Antti Haapala <antti.haapala@iki.fi>
0 siblings, 0 replies; 2+ messages in thread
From: Antti Haapala @ 2003-03-08 16:17 UTC (permalink / raw)
To: Eric Marsh <emarsh@mac.com>; +Cc: pgsql-admin
On Sat, 8 Mar 2003, Eric Marsh wrote:
> Good Morning,
>
> Does anyone have any idea why host=localhost is breaking my connection?
> Is there a configuration value I should be setting?
I don't know about PHP but usually specifying explicitly host=localhost
will try to connect via TCP/IP on localhost:5432, while default action
is to connect to local "unix domain" socket.
Localhost itself is a regular hostname, which usually should map to
loopback ip 127.0.0.1.
Check out PostgreSQL documentation for pg_hba.conf to allow TCP/IP
connections from localhost.
Also, postgresql.conf should contain line
tcpip_socket = on
--
Antti Haapala
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-03-08 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-08 14:54 Problem connecting with PHP in OS X Eric Marsh <emarsh@mac.com>
2003-03-08 16:17 ` Antti Haapala <antti.haapala@iki.fi>
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