Re: Unable to connect to Postgresql

From: John Iliffe <john(dot)iliffe(at)iliffe(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Cc: rob stone <floriparob(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Unable to connect to Postgresql
Date: 2017-04-10 14:38:09
Message-ID: 201704101038.10082.john.iliffe@iliffe.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 09 April 2017 22:07:12 rob stone wrote:
> On Sun, 2017-04-09 at 20:09 -0400, John Iliffe wrote:
> > >
> > >
> > > You have Apache, PHP, and Postgres all running on your LAN at
> > > 192.168.1.6.
> > >
> > >
> > >
> > >
> > > You are on 192.168.1.10.
> > >
> > >
> > >
> > > Your NOT doing "php -f testfcgi.php", so how does Apache "know" to
> >
> > run
> >
> > > that script?
> >
> > testfcgi.php is in the document root of the default named virtual
> > server.
>
> O.K.
>
> So in sites-available, your conf file just tells Apache to run
> testfcgi.php and nothing else?

Apache just runs the programme whose name follows the / in the URL.
Nothing fancy here at all. testfcgi.php is a php script that is run by
mod_php in Apache and uses the php command pg_connect() to try and reach
Postgresql. That works if Postgresql is reached via a TCP connection, as
suggested by Adrian yesterday, but not if the connection is using a Unix
domain socket, which is the usual way to do that.

Despite the name, testfcgi.php is running as a mod_php script, not a cgi.
That is the next step to get working!

Regards,

John
> There is no resolution required by obtaining the IP address from
> /etc/hosts.
>
> Are you able to put some trigger_error messages into testfcgi.php in
> order to make sure Apache is running the correct program?
>
> Cheers,
> Rob

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2017-04-10 14:49:57 Re: WAL being written during SELECT * query
Previous Message Tom DalPozzo 2017-04-10 13:53:32 Re: WAL being written during SELECT * query