Re: Accessing Postgres db from apache using PHP - Mailing list pgsql-php

From bruce
Subject Re: Accessing Postgres db from apache using PHP
Date
Msg-id 000501c354c4$33708080$0301a8c0@Mesa.com
Whole thread Raw
In response to Re: Accessing Postgres db from apache using PHP  (Rod Taylor <rbt@rbt.ca>)
Responses Re: Accessing Postgres db from apache using PHP
Re: Accessing Postgres db from apache using PHP
List pgsql-php
ok....

i'm still somewhat confused... this is probably a pg_hba.conf issue.....

my pg_hba.conf looks like:
# TYPE     DATABASE    IP_ADDRESS    MASK               AUTH_TYPE
AUTH_ARGUMENT

#local      all                                          trust
#host       all         127.0.0.1     255.255.255.255    trust

# Using sockets credentials for improved security. Not available everywhere,
# but works on Linux, *BSD (and probably some others)

#local  all ident   sameuser
#local   all                                             trust
#host   all             127.0.0.1       255.255.255.255 trust
#host   template1       127.0.0.1       255.255.255.255 trust
host    gforge  127.0.0.1       255.255.255.255 trust

i've logged into the server as gforge, and tried to do the psql command
    -> psql -h localhost gforge

psql: FATAL 1:  No pg_hba.conf entry for host 127.0.0.1, user gforge,
database gforge

i've also made sure the php.ini file is correct....
i can do a psql, and then a "\l" to see the gforge database

i've tried a number different settings in the pg_hba.conf file... with no
luck...

i'm willing to bet it's something pretty simple... but i can't see it..
searchs of google haven't shed any light!!!

a bottle of your favorite drink to whoever can help!!!!


thanks....

bruce
bedouglas@earthlink.net

ps...i'd even let someone remotely log in if it would help!!!


-----Original Message-----
From: pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]On Behalf Of Rod Taylor
Sent: Sunday, July 27, 2003 7:24 PM
To: bedouglas@earthlink.net
Cc: pgsql-novice@postgresql.org; pgsql-php@postgresql.org
Subject: Re: [PHP] Accessing Postgres db from apache using PHP


> i then do a:
>     $tmp = "host=localhost dbname=gforge user=gforge password=gforge";
>     $conn = @pg_connect($tmp);

Since host=localhost, the client will attempt to connect to the server
on 127.0.0.1.  By default, TCPIP access is not enabled.  To do so, see
postgresql.conf, make the change to the tcpip variable, and HUP the
server.

However, if you leave host=<blank>, the client will attempt to connect
to the server via the local domain socket which is both enabled by
default and should be a touch faster due to more efficient data
transmission.


pgsql-php by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Accessing Postgres db from apache using PHP
Next
From: Philipp Ottlinger
Date:
Subject: Re: Accessing Postgres db from apache using PHP