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
Subject: Re: Unable to connect to Postgresql
Date: 2017-04-10 13:36:15
Message-ID: 081a7f86-0488-4bb6-9754-4bb37a005fd2@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

John Iliffe wrote:

> > <?php echo file_exists("/tmp/.s.PGSQL.5432"); ?>
> >
> Basically, nothing.
>
> If I include it in an Apache script exactly as suggested, then the script
> puts out a blank screen, no error messages.

So from the point of view of the Apache process, that file does
not exist. That's consistent with the error you reported when
trying to connect through the Unix domain socket:

Unable to connect to PostgreSQL server: could not connect to server:
No such file or directory
Is the server running locally and accepting connections on
Unix domain socket "/tmp/.s.PGSQL.5432"?

If apache is chrooted, or secured by other means with the similar result
that it cannot access the full filesystem, that's expected.
In this case, connecting to localhost with TCP/IP rather than a Unix domain
socket looks like the simpler solution.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2017-04-10 13:46:54 Re: Unable to connect to Postgresql
Previous Message Steve Petrie, P.Eng. 2017-04-10 12:22:06 Re: TimeScaleDB -- Open Source Time Series Database Released (www.i-programmer.info);