From: | Jim Mercer <jim(at)reptiles(dot)org> |
---|---|
To: | Paulo Parola <pgsql(at)brazilinfo(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgreSQL(dot)org> |
Subject: | Re: [GENERAL] No pg_hba.conf entry ??? |
Date: | 2000-02-21 17:00:24 |
Message-ID: | 20000221120023.P365@reptiles.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> The command to connect inside the script is the following:
>
> if ( !($pgconn = pg_connect("localhost", "5432", "", "", "photos")) )
> {
> echo "Bad connection to database!<p>Sorry<p>.\n";
> }
>
> My 'pg_hba.conf' is located inside directory 'data' below
>
> local all trust
> host all 127.0.0.1 255.255.255.255 trust
hmmm, i should have looked closer than i did before replying.
if the scripts are running on the same machine as the database, then it
should work fine as above.
if the scripts are running on a different machine, then the php code needs
to be changed to use:
> if ( !($pgconn = pg_connect("xxx", "5432", "", "", "photos")) )
where xxx is the name or ip address of the database server.
the database server would need a pg_hba.conf entry like:
> host all xxx 255.255.255.255 trust
where xxx is the ip address of the machine running the scripts.
--
[ Jim Mercer jim(at)reptiles(dot)org +1 416 506-0654 ]
[ Reptilian Research -- Longer Life through Colder Blood ]
[ Don't be fooled by cheap Finnish imitations; BSD is the One True Code. ]
From | Date | Subject | |
---|---|---|---|
Next Message | Paulo Parola | 2000-02-21 17:01:58 | No pg_hba.conf entry ??? |
Previous Message | Jim Mercer | 2000-02-21 16:55:56 | Re: [GENERAL] No pg_hba.conf entry ??? |