Help in connecting to a database with PHP
am 27.05.2002 08:07:20 von mmcgillickThis is a multi-part message in MIME format.
------=_NextPart_000_0006_01C20523.3EC00100
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
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
------=_NextPart_000_0006_01C20523.3EC00100
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
0.0pt;
font-family:Arial'>Hi:
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'>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, op=
en
and work in the database on my machine. However, if I create a .php page wi=
th
the following information:
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'> $db =3D pg_connect(“dbname=3Dbaseball
user=3Dpostgres”);
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'>I get the following error message:
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'> Warning=
:
Unable to connect to PostgreSQL server: FATAL 1: IDENT authentication failed
for user “postgres” in /var/www/html/baseball.php on line 10.=
span>
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'>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 s=
witch
to the user postgres and connect to the database with no problems. I can vi=
ew
data, add and delete records, etc.
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'>I’d appreciate some help in trying to track down w=
hat
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.
0.0pt;
font-family:Arial'>
0.0pt;
font-family:Arial'>- Michael
------=_NextPart_000_0006_01C20523.3EC00100--