From: | Riza Fahmi <riza(dot)fahmi(at)myrealbox(dot)com> |
---|---|
To: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Help with pg_connect() command. |
Date: | 2003-05-11 11:31:12 |
Message-ID: | 215930767.20030511183112@myrealbox.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
You must setting postgres to run under localhost. To do that, first
you must edit pg_hba.conf under /var/lib/pgsql/data/ and find:
# local all trust
# host all 127.0.0.1 255.255.255.255 trust
and then remove the comment('#'), and don't forget to save the file.
Just that.
Riza Fahmi
---Sunday, May 11, 2003, 6:20:54 AM, pgsql-novice(at)postgresql(dot)org wrote:
SK> Hello,
SK> I'm having problems connecting to a postgre database
SK> from my PHP code. The code I'm using is:
SK> $conn = pg_connect("host=localhost port=5432
SK> dbname=movies ")
SK> or die("Couldn't make a connection");
SK> And the warning message I get is:
SK> Warning: pg_connect() unable to connect to PostgreSQL
SK> server: could not connect to server: Connection
SK> refused Is the server running on host localhost and
SK> accepting TCP/IP connections on port 5432? in
SK> /var/www/html/testpostgre.php on line 11
SK> Couldn't make a connection
SK> Am I missing anything here? Thanks in advance for your
SK> help.
SK> Steve
SK> __________________________________
SK> Do you Yahoo!?
SK> The New Yahoo! Search - Faster. Easier. Bingo.
SK> http://search.yahoo.com
SK> ---------------------------(end of broadcast)---------------------------
SK> TIP 4: Don't 'kill -9' the postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | micke | 2003-05-11 17:02:41 | why are these query results differing? |
Previous Message | Terence Ng | 2003-05-11 01:23:24 | Re: [ADMIN] Multilingual database |