Re: Unable to connect to Postgresql

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "John Iliffe" <john(dot)iliffe(at)iliffe(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org,"Adrian Klaver" <adrian(dot)klaver(at)aklaver(dot)com>,"Joe Conway" <mail(at)joeconway(dot)com>
Subject: Re: Unable to connect to Postgresql
Date: 2017-04-10 13:46:54
Message-ID: ab25b2c6-7bde-4861-9feb-8ab52f43c900@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John Iliffe wrote:

> 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?

pg_connect("host=/var/pgsql [...other parameters...]")

The fact that the value for host starts with a slash indicates
without ambiguity that it's a path on disk rather than the name
or address of a host on the network.

However if apache runs in a chroot jail, it should no more see
/var/pgsql than it sees /tmp
Given an apache process id, on Linux you should be able
to check the current filesystem-root of that process with
# ls -ld /proc/$PID/root
It should show a soft link to the directory that corresponds to
the root from the point of view of the $PID process.

But again, most people would use host=localhost in this setup.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom DalPozzo 2017-04-10 13:53:32 Re: WAL being written during SELECT * query
Previous Message Daniel Verite 2017-04-10 13:36:15 Re: Unable to connect to Postgresql