Re: [PHP] Accessing Postgres db from apache using PHP

From: "bruce" <bedouglas(at)earthlink(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>, <pgsql-php(at)postgresql(dot)org>, "'Rod Taylor'" <rbt(at)rbt(dot)ca>
Subject: Re: [PHP] Accessing Postgres db from apache using PHP
Date: 2003-07-28 04:53:32
Message-ID: 000501c354c4$33708080$0301a8c0@Mesa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice 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(at)earthlink(dot)net

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

-----Original Message-----
From: pgsql-php-owner(at)postgresql(dot)org
[mailto:pgsql-php-owner(at)postgresql(dot)org]On Behalf Of Rod Taylor
Sent: Sunday, July 27, 2003 7:24 PM
To: bedouglas(at)earthlink(dot)net
Cc: pgsql-novice(at)postgresql(dot)org; pgsql-php(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message christoph.dellavalle 2003-07-28 07:10:39 Re: Accessing Postgres db from apache using PHP
Previous Message A.Bhuvaneswaran 2003-07-28 03:56:33 Re: Where's The Primary Key?

Browse pgsql-php by date

  From Date Subject
Next Message christoph.dellavalle 2003-07-28 07:10:39 Re: Accessing Postgres db from apache using PHP
Previous Message A.Bhuvaneswaran 2003-07-28 03:52:10 Re: Accessing Postgres db from apache using PHP