Re: [GENERAL] Unable to connect to Postgresql

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: [GENERAL] Unable to connect to Postgresql
Дата
Msg-id 9b3ca09e-4cf3-bcda-ae45-488131e4a27a@aklaver.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Unable to connect to Postgresql  (John Iliffe <john.iliffe@iliffe.ca>)
Ответы Re: [GENERAL] Unable to connect to Postgresql
Список 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.klaver@aklaver.com


В списке pgsql-general по дате отправления:

Предыдущее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql
Следующее
От: Günce Kaya
Дата:
Сообщение: Re: [GENERAL] [ADMIN] calculating table and index size