From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | John Iliffe <john(dot)iliffe(at)iliffe(dot)ca>, pgsql-general(at)postgresql(dot)org |
Cc: | Joe Conway <mail(at)joeconway(dot)com> |
Subject: | Re: Unable to connect to Postgresql |
Date: | 2017-04-10 03:21:58 |
Message-ID: | 9b3ca09e-4cf3-bcda-ae45-488131e4a27a@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 04/09/2017 05:30 PM, John Iliffe wrote:
> On Sunday 09 April 2017 20:01:32 Adrian Klaver wrote:
>> So the issue is in PHP via Apache using the socket, because if I
>> remember right you used localhost in the Apache/PHP combination and it
>> worked, correct?
>
> Yes.
>
> I think there is some confusion here, might be on my part, I don't know.
>
> There is a network connection from 192.168.1.10 to 192.168.1.6 to Apache
> and then there should be a connection from Apache on using localhost (or
> 127.0.0.1) to Postgresql. So shouldn't that be sufficient? Other than the
> original error on my part, coding the server's external address
> (192.168.1.6) in the db_connect() call which is now fixed, shouldn't the
> pg_hba host address line be 127.0.0.1/32 ?
Yes, Apache is connecting to Postgres on the same machine so localhost
should be sufficient for IP purposes.
Not sure that it applies here, but what does ifconfig show?
>
> Anyhow, that is working properly now. The domain socket doesn't have an
> explicit address (for 'local') as it is on the current machine as far as I
> understand.
>
> Am I correct?
Correct. The issue is then why psql and stand alone PHP can see the
domain socket while PHP through Apache does not. Not sure why that is at
the moment. Hmm, had a thought. What user is Apache running as and does
that user have permissions on the socket file(s)?
>
> John
>>
>>>> Report back.
>>>>
>>>>> Based on the reference that Joe sent earlier, I do have a second
>>>>> domain socket on /var/pgsql but the problem is how do I get PHP to
>>>>> look there? There isn't any config file for mod_php and php-fpm has
>>>>> one but the location of the domain socket is the default -
>>>>> /tmp/.s.......
>>>>>
>>>>> I don't think this is the problem if this list unless someone
>>>>> happens to know the solution. If not, then thank you for all the
>>>>> work, and especially for the promptness of the responses. I'm not
>>>>> at all sure that I could have figured this out by myself.
>>>>>
>>>>> John
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Günce Kaya | 2017-04-10 07:19:16 | Re: [GENERAL] calculating table and index size |
Previous Message | rob stone | 2017-04-10 02:07:12 | Re: Unable to connect to Postgresql |