Re: Unable to connect to Postgresql

From: John Iliffe <john(dot)iliffe(at)iliffe(dot)ca>
To: rob stone <floriparob(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, 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 00:09:08
Message-ID: 201704092009.08111.john.iliffe@iliffe.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday 09 April 2017 17:39:30 rob stone wrote:
> Hello John,
>
> > >
> > >
> > > > PHP and Postgresql are both running on same box. It does have
> >
> > two
> >
> > > > interfaces, 192.168.1.6 and 192.168.1.7, and the test programme
> >
> > is
> >
> > > > available on either. The reference to 192.168.1.10 is the client
> > > > machine, in this case my workstation, which is 192.168.1.10.
> > >
> > >
> > >
> > > Here is the error message you said came from the box running PHP:
> > > >> > ------------------------------------------
> > > >> > [Sun Apr 09 14:08:16.178126 2017] [php7:warn] [pid 24917:tid
> > > >> > 139671464015616] [client 192.168.1.10:59260] PHP Warning:
> > > >> > pg_connect(): Unable to connect to PostgreSQL server: could
> >
> > not
> >
> > > >> > connect to server: Connection refused\n\tIs the server running
> >
> > on
> >
> > > >> > host &quot;192.168.1.6&quot; and accepting\n\tTCP/IP
> >
> > connections on
> >
> > > >> > port 5432? in
> > > >> > /httpd/iliffe/testfcgi.php on line 132
> > > >> > -------------------------------------------
> > >
> > >
>
> This is a tad confusing to me.
>
> 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.
>
> Cheers,
> Rob

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Iliffe 2017-04-10 00:19:14 Re: Unable to connect to Postgresql
Previous Message Adrian Klaver 2017-04-10 00:07:01 Re: Unable to connect to Postgresql