Re: Not able to connect to server from PHP - Mailing list pgsql-php

From Chadwick Rolfs
Subject Re: Not able to connect to server from PHP
Date
Msg-id Pine.SOL.3.96.1020123134218.18040B-100000@shell.gis.net
Whole thread Raw
In response to Not able to connect to server from PHP  (Jeff Self <jself@ci.newport-news.va.us>)
List pgsql-php
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*--


pgsql-php by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: "SQL" REPLACE SYNTAX
Next
From: Vince Vielhaber
Date:
Subject: Re: "SQL" REPLACE SYNTAX