Re: [pgsql] connectivity problem
| From: | Jurgen Stroo | Date: | Sun, 18 Jul 2004 13:19:52 +0000 |
| Subject: | Re: [pgsql] connectivity problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190910@lists.php.net to get a copy of this message | ||
Well, then something went wrong with your postgres installation.
This file should be somewhere in /etc (/etc/postgresql/pg_hba.conf for
example). If this is your own system try to search for it, like this
for example:
find /etc -name pg_hba.conf
If it is missing, you can create it yourself, but personally I think you
should check WHY you don't have it, may be something more is missing.
But to connect to a postgres database I think you need to read some more
about postgres at least, so you know how it works and you can decide
which way you want to connect to postgres (if you want to use the safe ident authentication, for
example)
I can paste some default entries into this mail for you (version 7.4.3):
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
# Database administrative login by UNIX sockets
local all postgres ident sameuser
#
# All other connections by UNIX sockets
local all all ident sameuser
#
# All IPv4 connections from localhost
host all all 127.0.0.1 255.255.255.255 ident sameuser
#
# All IPv6 localhost connections
host all all ::1
ffff:ffff:ffff:ffff:ffff:ffff:
ffff:ffff ident sameuser
host all all ::ffff:127.0.0.1/128 ident
sameus
er
#
# reject all other connection attempts
host all all 0.0.0.0 0.0.0.0 reject
You can have a free read about postgresql at commandprompt.com, there is
a O'Reilly book to be found there, freely available through the Public
license.
Good luck!
Ugh! Blurg.
---------------------------------------------------------------------------
"When a man sits with a pretty girl for an hour, it seems like a minute.
But let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." [A. Einstein, 1938]
http://jurgenstroo.com
This one time, at band camp, Ciprian Constantinescu said:
> I have the following code
>
> [CODE]
> <?php
> $dbconn3 = pg_connect("host=somehost port=5432 dbname=adatabase
> user=postgres");
> ?>
> [/CODE]
>
> And when i run the script I get " Warning: pg_connect()
> [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL:
> missing or erroneous pg_hba.conf file"
>
> I have searched for pg_hba.conf, but I don't have it. Where should it be and
> what should it contain?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>