Re: php password authentication failed for user ...

From: basti <mailinglist(at)unix-solution(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: php password authentication failed for user ...
Date: 2014-07-09 13:10:55
Message-ID: 53BD3F5F.3030208@unix-solution.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

There are other entrys in pg_hab.conf and yes the passwd is correct.
(psql -p ... -h ... from command line runs well).

I don't know whats wrong there
host mydns mydns localhost trust
works well and

#host all all 0.0.0.0 0.0.0.0 md5
did not work.

I use Postgres 9.3.4-1.pgdg70+1. (debian)

Am 09.07.2014 15:06, schrieb Adrian Klaver:
> On 07/09/2014 04:04 AM, basti wrote:
>> Hello my pg_hab.conf has this entry:
>>
>> host all all 127.0.0.1/32 md5
>
> Is that the only entry?
>
> If not remember first matching entry wins, so is there another line
> above this?
>
>>
>> When I try to use PHP to connect to the Database I get
>>
>> "postgres password authentication failed for user ..."
>
> Is the password correct?
>
>>
>> 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.");
>> }
>>
>> When I try to connect via
>> psql -U user -h localhost -W database
>> I can connect without error.
>>
>> I also use SSL connections, is this the problem? or in other words is
>> there a way to connect php via (postgres) ssl?
>
> From:
>
> http://www.postgresql.org/docs/9.3/interactive/auth-pg-hba-conf.html
>
> host
>
> This record matches connection attempts made using TCP/IP. host
> records match either SSL or non-SSL connection attempts.
>
>
>>
>> Regards,
>> basti
>>
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rob stone 2014-07-09 13:19:48 Re: php password authentication failed for user ...
Previous Message Adrian Klaver 2014-07-09 13:06:08 Re: php password authentication failed for user ...