[GENERAL] Unable to connect to Postgresql - Mailing list pgsql-general

From John Iliffe
Subject [GENERAL] Unable to connect to Postgresql
Date
Msg-id 201704071738.22937.john.iliffe@iliffe.ca
Whole thread Raw
Responses Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [GENERAL] Unable to connect to Postgresql  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
When I attempt to run any web application php cannot open a database
because of failure to connect.  (Please disregard the programme name, it is
running in mod_php, not as an fcgi module).  The (php) message is:

--------------------------
[Fri Apr 07 17:03:28.597101 2017] [php7:warn] [pid 1797:tid
140599445419776] [client 192.168.1.10:45127] PHP Warning:  pg_connect():
Unable to connect to PostgreSQL server: could not connect to server: No
such file or directory\n\tIs the server running locally and
accepting\n\tconnections on Unix domain socket
"/tmp/.s.PGSQL.5432"? in /httpd/iliffe/testfcgi.php on line 121
----------------------------

The proper socket does exist:

-------------------------------------
ls -al /tmp | grep PGSQL
srwxrwxrwx.  1 postgres postgres    0 Apr  7 16:53 .s.PGSQL.5432
-rw-------.  1 postgres postgres   49 Apr  7 16:53 .s.PGSQL.5432.lock

ss -a | grep 5432
u_str  LISTEN     0      128    /tmp/.s.PGSQL.5432 30480                * 0
-------------------------------------

Running on Fedora 25 with SELinux in PERMISSIVE mode.  The audit log shows
no hits on Postgresql.

Postgresql version number is 9.6.2

As expected, the postgresql log shows nothing since the last start up.

Thanks in advance.

John
=====================================


pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] SELECT and RowExclusiveLock
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Unable to connect to Postgresql