pg.ddx.io pgsql-php@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Chadwick Rolfs <cmr@shell.gis.net>
To: Jeff Self <jself@ci.newport-news.va.us>
Cc: pgsql-php@postgresql.org
Subject: Re: Not able to connect to server from PHP
Date: Wed, 23 Jan 2002 13:46:57 -0500 (EST)
Message-ID: <Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net> (raw)
In-Reply-To: <1011730382.15600.8.camel@personnel_test>
I had the same problem, and found identd to be sending encrypted usernames
for authentication. If you're fine with trust (those of us with paranoid
settings are never fine with trust), cool. If you don't want to use
trust, try passwd, or something else. I think the original problem is the
identd sending encrypted usernames...man identd.
Maybe php can encrypt your username the same way? That way you don't have
to trust anyone:)
On 22 Jan 2002, Jeff Self wrote:
> I'm working on a personnel database for my department. I can connect
> just fine using 'psql personnel'. I've created a PHP script to get a
> list of departments, but I'm getting the following error message:
>
> Warning: Unable to connect to PostgreSQL server: Peer authentication
> failed for user 'jeff' in /var/www/personnel/departments.php on line 10
> Unable to connect to database.
>
> Here's my script:
> <?php
> //
> // Display Departments
> //
> // departments.php, v 1.0
>
> include ($DOCUMENT_ROOT.'/personnel/include/functions.inc');
>
> $conn = pg_pconnect("dbname=personnel user=jeff");
> if (!$conn) {
> echo "Unable to connect to database.";
> exit;
> }
>
> Everything is running locally right now, Apache, PHP, PostgreSQL. I
> never modified my pg_hba.conf file. Everything looks identical as my
> system at home. I'm running PostgreSQL 7.1.3 and PHP 4.1.1.
> --
> Jeff Self
> City of Newport News
> 2400 Washington Ave.
> Newport News, VA 23607
> 757-926-6930
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
Chadwick Rolfs - cmr@gis.net
Cleveland State University - Student
Music Major - The Holden Arboretum Volunteer
Computer Programmer - Student Employee
--*I finally found powdered water;
I just can't figure out what to add to it*--
view thread (8+ messages)
Message-ID: <Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net> Permalink: ../Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net/ Also on: postgresql.org/message-id/Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net ·
reply
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: cmr@shell.gis.net, jself@ci.newport-news.va.us Subject: Re: Not able to connect to server from PHP In-Reply-To: <Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net> References: <1011730382.15600.8.camel@personnel_test> <Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net> * 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