Re: php connection failure - Mailing list pgsql-general

From Adrian Klaver
Subject Re: php connection failure
Date
Msg-id 539a1cdd-69bf-48ec-dd57-93d1592d6c3c@aklaver.com
Whole thread Raw
In response to Re: php connection failure  (ourdiaspora <ourdiaspora@protonmail.com>)
List pgsql-general
On 8/11/21 10:02 AM, ourdiaspora wrote:
> 
> On Wednesday, August 11th, 2021 at 3:09 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
> 
>>
>> Is the Web server/PHP app on the same machine as the Postgres server?
>>
> 
> All programs about this question are installed on a single computer; the intention is to test and learn first on a
localmachine.
 
> 
>> If it is on the same machine what happens if you do?:
>>
>> $dbconn = pg_connect("dbname=cpacweb user=cpaca") or die("Could not
>>
>> connect");
>>
> 
> Am happy to report that connection looks successful, because the php web page now reports:
> 
> "
>     Connection status ok
> "

That is just working around the problem, which is something is blocking 
the TCP port 5432 on localhost. Generally speaking, that should not be 
happening. You need to figure out what is doing this or you will 
probably be facing more issues down the road. From what you have shown 
it seems to be related to the Web application itself. I would try with 
pg_connect("dbname=cpacweb user=cpaca host=localhost") and look at the 
Web server logs.

> 
> Thank you all very much for the help. Hope that other novices benefit too! :)
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: (13.1) pg_basebackups ./. pg_verifybackup
Next
From: Matthias Apitz
Date:
Subject: Re: (13.1) pg_basebackups ./. pg_verifybackup