Help in connecting to a database with PHP

Поиск
Список
Период
Сортировка
От Michael J. McGillick
Тема Help in connecting to a database with PHP
Дата
Msg-id !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATMX1T/YgGEKM6LUYbjsZU8KAAAAQAAAAE7U800jk30SH8CZ2ndzvnQEAAAAA@attbi.com
обсуждение исходный текст
Ответы Re: Help in connecting to a database with PHP  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Re: Help in connecting to a database with PHP  (Eckhard Hoeffner <e-hoeffner@fifoost.org>)
Список pgsql-php

Hi:

 

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:

 

   $db = pg_connect(“dbname=baseball user=postgres”);

 

I get the following error message:

 

   Warning: Unable to connect to PostgreSQL server: FATAL 1: IDENT authentication failed for user “postgres” in /var/www/html/baseball.php on line 10.

 

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.

 

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.

 

- Michael

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

Предыдущее
От: Keary Suska
Дата:
Сообщение: Re: Inventory
Следующее
От: Ludwig Lim
Дата:
Сообщение: Re: Help in connecting to a database with PHP