Re: problem with connection to remote server

From: Andrew McMillan <andrew(at)morphoss(dot)com>
To: Ireneusz(dot)Tarnowski(at)pwr(dot)wroc(dot)pl
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: problem with connection to remote server
Date: 2010-01-28 10:02:35
Message-ID: 1264672955.25189.256.camel@happy.home.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Thu, 2010-01-28 at 10:51 +0100, Ireneusz Tarnowski wrote:
> Hi,
>
> I have some PHP application and 2 postgreSQL remote servers.
> All servers are runing under Solaris 10.
>
> I can connect from application to one postgresql server and all work
> fine. I have to move database to second server. I export/import data.
> Check all data inside database - OK. I can't connect from php
> application into second postgresql server.
>
> I test if it possible to connect using psql -h remote_server and I
> can connect. I check firewall's ... but I can connect between
> application serwer and postgresql server using CMD (psql). Only PHP
> application can't connect. Otherside ... the PHP application works
> fine with first postgresql server (and PHP configuration supports
> psql).
>
> I compared TCP packets and it looks like the application and server
> drop connection after first 2 packets (ACK).

The place to look for error messages is in the PostgreSQL server log. I
would bet that it is rejecting the connection because the source ip/user
are different.

When you connect from the command-line it is probably using ident
information and that connection is being allowed, but the PHP
application will be running as the webserver user and will need
different credentials.

Check your pg_hba.conf file on the server and adjust it to let the
desired connection happen.

Cheers,
Andrew.

------------------------------------------------------------------------
http://andrew.mcmillan.net.nz/ Porirua, New Zealand
Twitter: _karora Phone: +64(272)DEBIAN
Be different: conform.
------------------------------------------------------------------------

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Bill Moran 2010-01-28 12:43:00 Re: problem with connection to remote server
Previous Message Ireneusz Tarnowski 2010-01-28 09:51:41 problem with connection to remote server