pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Self <jself@ci.newport-news.va.us>
To: pgsql-php@postgresql.org
Subject: Not able to connect to server from PHP
Date: 22 Jan 2002 15:13:01 -0500
Message-ID: <1011730382.15600.8.camel@personnel_test> (raw)

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




view thread (8+ messages)  latest in thread

Message-ID: <1011730382.15600.8.camel@personnel_test>
Permalink:  ../1011730382.15600.8.camel@personnel_test/
Also on:    postgresql.org/message-id/1011730382.15600.8.camel@personnel_test

 · 

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: jself@ci.newport-news.va.us
  Subject: Re: Not able to connect to server from PHP
  In-Reply-To: <1011730382.15600.8.camel@personnel_test>
  References: <1011730382.15600.8.camel@personnel_test>

* 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