Not able to connect to server from PHP

Поиск
Список
Период
Сортировка
От Jeff Self
Тема Not able to connect to server from PHP
Дата
Msg-id 1011730382.15600.8.camel@personnel_test
обсуждение исходный текст
Ответы Re: Not able to connect to server from PHP  (Chadwick Rolfs <cmr@shell.gis.net>)
Список pgsql-php
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


В списке pgsql-php по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Long running queries and timeouts
Следующее
От: timothy_maguire@hartehanks.com
Дата:
Сообщение: Re: Not able to connect to server from PHP