Re: php password authentication failed for user ...

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: basti <mailinglist(at)unix-solution(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: php password authentication failed for user ...
Date: 2014-07-09 13:56:24
Message-ID: CAOR=d=3xoF1Wx_Nimz4uFJeXJRSiVj-sRs07VktdnTAK0aTTmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 9, 2014 at 5:04 AM, basti <mailinglist(at)unix-solution(dot)de> wrote:
> Hello my pg_hab.conf has this entry:
>
> host all all 127.0.0.1/32 md5
>
> When I try to use PHP to connect to the Database I get
>
> "postgres password authentication failed for user ..."
>
> The PHP-code looks like
>
>
> global $dbhost, $dbuser, $dbpass, $dbname, $use_pgsql, $dbconn;
>
> if ($use_pgsql)
> {
> $connect = "host=$dbhost user=$dbuser password=$dbpass
> dbname=$dbname";
> echo $connect;
> if (!($dbconn = pg_connect($connect)))
> {
> open_page();
> ErrSQL("Unable to connect to database.");
> }

This is not proper error handling. Use the pg_* functions that report
the actual error, not some string you made on your own.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson F. Lidorio 2014-07-09 13:56:59 Download Postgresql 9.4 beta for Windows is not available.
Previous Message hubert depesz lubaczewski 2014-07-09 13:54:35 Re: BAKUP ISSUE