Re: Unable to connect to Postgresql

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: John Iliffe <john(dot)iliffe(at)iliffe(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unable to connect to Postgresql
Date: 2017-04-07 23:51:57
Message-ID: f5037df2-4cc5-704d-3dce-82462e2116de@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/07/2017 04:57 PM, John Iliffe wrote:
> Hi Adrian:
>
> Not the same problem.
>
> Last time I couldn't get postgresql running at all. This time it is
> running and I can't connect to it. I did check for something else holding
> the socket, but as far as I can see nothing else has it.

So when was the last time you could connect and has anything of note
happened since then?

>
> Regards,
>
> John
> ===================================
> On Friday 07 April 2017 18:51:33 Adrian Klaver wrote:
>> On 04/07/2017 02:38 PM, John Iliffe wrote:
>>> 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
>>> &quot;/tmp/.s.PGSQL.5432&quot;? 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.
>>
>> Well the last time this happened the answer was this:
>>
>> https://www.postgresql.org/message-id/25543.1489081789%40sss.pgh.pa.us
>>
>>> Thanks in advance.
>>>
>>> John
>>> =====================================
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Iliffe 2017-04-07 23:57:22 Re: Unable to connect to Postgresql
Previous Message Adrian Klaver 2017-04-07 22:58:15 Re: Unable to connect to Postgresql