As I said in my first post, I tried the following connection strings as
well:
"dbname=thornvalley user=apache password=[passwd]"
"dbname=thornvalley user=apache password=[passwd] host=localhost port=5432"

and had the same results. After messing around with pg_hba.conf (I set local
authentication to 'password' instead of 'ident', I was able to get an error
message /when I used the wrong password/:

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL
server: FATAL: Password authentication failed for user "apache" . in
/var/www/html/dbtest.php on line 3
error

If I used the correct password, that message would not appear. Furthermore,
when I added the line
echo "$myconn = ".$myconn;
to my script after pg_connect(), I would get:

$myconn = Resource id #2

which suggessts to me that it is successful in connecting to the db server,
but, for some reason PHP is unable to use the connection after that. Like I
said, it's weird. I have no idea why it's doing that.

----- Original Message -----
From: "Dave Brunberg" <[EMAIL PROTECTED]>
To: "'Nathaniel Price'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, March 28, 2003 12:24 PM
Subject: RE: [PHP-DB] Connection issues with pgsql?


> I'd suggest building a connection string, explicitly defining the user and
> password.  Maybe it would give you a more descriptive error that way
> ("invalid user", etc.).
>
> The other thing I've done is do something like this:
>
> $database = pg_connect ($conn_string)
> or die ("Help! No connection to the database! Error: " .
> pg_last_error());
>
>
> That may give you some more diagnostic info?
>
> dwb
> > -----Original Message-----
> > From: Nathaniel Price [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 28, 2003 2:05 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Connection issues with pgsql?
[snip]
> > I have
> > tried using
> > other connection strings as well:
> > "dbname=thornvalley user=apache password=[passwd]"
> > "dbname=thornvalley user=apache password=[passwd]
> > host=localhost port=5432"
> >
> > with the same result.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to