Search Postgresql Archives

Re: php connection failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/11/21 10:02 AM, ourdiaspora wrote:

On Wednesday, August 11th, 2021 at 3:09 PM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> 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 local machine.

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@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux