Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 72BE2633360 for ; Thu, 28 Jan 2010 08:43:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17546-04 for ; Thu, 28 Jan 2010 12:43:03 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.potentialtech.com (internet.potentialtech.com [66.167.251.6]) by mail.postgresql.org (Postfix) with ESMTP id 04306633239 for ; Thu, 28 Jan 2010 08:43:03 -0400 (AST) Received: from localhost (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.potentialtech.com (Postfix) with ESMTPSA id 58CEEF7419; Thu, 28 Jan 2010 07:43:01 -0500 (EST) Date: Thu, 28 Jan 2010 07:43:00 -0500 From: Bill Moran To: Andrew McMillan Cc: Ireneusz.Tarnowski@pwr.wroc.pl, pgsql-php@postgresql.org Subject: Re: problem with connection to remote server Message-Id: <20100128074300.59a4591d.wmoran@potentialtech.com> In-Reply-To: <1264672955.25189.256.camel@happy.home.mcmillan.net.nz> References: <72b0d9d047b1.4b616c3d@pwr.wroc.pl> <1264672955.25189.256.camel@happy.home.mcmillan.net.nz> Organization: Bill Moran X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.5; i386-portbld-freebsd7.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/8 X-Sequence-Number: 4106 In response to Andrew McMillan : > 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. In addition to this, PHP will give some pretty useful error messages when it can't connect. If you're not seeing those, then you should adjust your application logic to log them, it will make your life a lot easier. If they don't clearly define the problem, post them here ... I (and others like me) have seen them enough to know what they indicate. -- Bill Moran http://www.potentialtech.com http://people.collaborativefusion.com/~wmoran/