From: Eckhard Hoeffner <e-hoeffner@fifoost.org>
To: pgsql-php@postgresql.org
Subject: Re: Help in connecting to a database with PHP
Date: Mon, 27 May 2002 11:30:36 +0200
Message-ID: <20020527093036.GA10328@fifoost.org> (raw)
In-Reply-To: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATMX1T/YgGEKM6LUYbjsZU8KAAAAQAAAAE7U800jk30SH8CZ2ndzvnQEAAAAA@attbi.com>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATMX1T/YgGEKM6LUYbjsZU8KAAAAQAAAAE7U800jk30SH8CZ2ndzvnQEAAAAA@attbi.com>
* Michael J. McGillick <mmcgillick@attbi.com> [27 05 02 08:07]:
>Hi:
>
>
>
>I'm trying to learn how to set up a .php file to connect to my
>PostgreSQL database. From the command line, I can connect, open and work
>in the database on my machine. However, if I create a .php page with the
>following information:
>
>
>
> $db = pg_connect("dbname=baseball user=postgres");
>
>
>
>I get the following error message:
If you are accessing the database via a web server, you should allow
TCP/IP connections. (postmaster -i)
> Warning: Unable to connect to PostgreSQL server: FATAL 1: IDENT
>authentication failed for user "postgres" in /var/www/html/baseball.php
>on line 10.
This looks like a socket connection, not TCP/IP.
>
>
>I'm running a stock Red Hat Linux 7.3 machine with PostgreSQL version
>7.2. I have verified that from the command line, I can switch to the
>user postgres and connect to the database with no problems. I can view
>data, add and delete records, etc.
>
>
>
>I'd appreciate some help in trying to track down what I'm doing wrong.
>I've spent the past few days looking at documentation from various web
>sites, and nothing seems to jump out as the culprit.
>
>
>
>- Michael
>
--
--//--\\--
Eckhard Hoeffner
e-hoeffner@fifoost.org
Tal 44
D-80331 München
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: e-hoeffner@fifoost.org
Subject: Re: Help in connecting to a database with PHP
In-Reply-To: <20020527093036.GA10328@fifoost.org>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATMX1T/YgGEKM6LUYbjsZU8KAAAAQAAAAE7U800jk30SH8CZ2ndzvnQEAAAAA@attbi.com> <20020527093036.GA10328@fifoost.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox