Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3DD1F475C73 for ; Mon, 27 May 2002 05:30:36 -0400 (EDT) Received: from localhost (p508017C9.dip.t-dialin.net [80.128.23.201]) by postgresql.org (Postfix) with ESMTP id 8B11E475C55 for ; Mon, 27 May 2002 05:30:35 -0400 (EDT) Received: from eckhard by localhost with local (Exim 3.35 #1 (Debian)) id 17CGpo-0002h4-00 for ; Mon, 27 May 2002 11:30:36 +0200 Date: Mon, 27 May 2002 11:30:36 +0200 From: Eckhard Hoeffner To: pgsql-php@postgresql.org Subject: Re: Help in connecting to a database with PHP Message-ID: <20020527093036.GA10328@fifoost.org> Mail-Followup-To: pgsql-php@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.3.28i X-Archive-Number: 200205/90 X-Sequence-Number: 1222 * Michael J. McGillick [27 05 02 08:07]: >Hi: > >=20 > >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: > >=20 > > $db =3D pg_connect("dbname=3Dbaseball user=3Dpostgres"); > >=20 > >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.=20 >=20 > >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. > >=20 > >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. > >=20 > >- Michael > --=20 --//--\\-- Eckhard Hoeffner e-hoeffner@fifoost.org Tal 44=20 D-80331 M=FCnchen