Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BA61AD32489 for ; Mon, 30 Apr 2012 13:41:06 -0300 (ADT) Received: from zeus.netdynamics.gr ([94.229.71.8]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SOtel-0000Ga-54 for pgsql-php@postgresql.org; Mon, 30 Apr 2012 16:41:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=telesuite.gr; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:In-Reply-To:References:To:From; bh=Prpu2sOJ+YO26BvETuGj69KgJvrfzALym3LW4gF5j68=; b=KUcq/EApTcdErJDtRrb1VrzqvrckdaDs81NKxUei9lSs5MFPw6zeFRof0Ly3JlBjCLvcneG1YdpB3egRyl0/nivsrltkxJ+Rm8st72fXTTov3d4M05GLLdKN5YNknVsP; Received: from sakeldim.static.otenet.gr ([83.235.183.180]:28532 helo=toshiba) by zeus.netdynamics.gr with esmtps (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1SOteY-0005R8-Pe; Mon, 30 Apr 2012 19:40:47 +0300 From: "Dimitris Sakellarios" To: , References: In-Reply-To: Subject: Re: Cannot connect to remote postgres using php Date: Mon, 30 Apr 2012 19:40:36 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00E2_01CD2709.1E58FDF0" X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac0m6hICGDoFosmsTQCaraQnQG1eGAAAGhEAAAEFwmAAABu9kA== X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463 X-ACL-Warn: { X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - zeus.netdynamics.gr X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - telesuite.gr X-Source: X-Source-Args: X-Source-Dir: X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201204/17 X-Sequence-Number: 4236 This is a multi-part message in MIME format. ------=_NextPart_000_00E2_01CD2709.1E58FDF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit First of all set all firewall down and then test again. I remember you said that the PHP server and the PGSQL server are on different machines? Is that correct? If so how did you succeed to connect to local host? Did you move your PHP code to the same machine hosting your PGSQL server or do you host a PGSQL server on both machines? Provide some more details (a small design) to give more help else it is hopeless like that sorry. Also provide the the part of the PHP you try to create the connection. Try the below proposal. On server that host the PHP (IP=y.y.y.y) On server that host PGSQL (IP=x.x.x.x) Inside pg_hba.conf . hostnossl all all 0.0.0.0/0 trust .. Inside postgresql.conf listen_addresses = 'x.x.x.x,localhost' port = 5432 Test and report. BR, Sakellarios Dimitris Telesuite ltd Telecommunication and Internet Services Address : T. Sofouli 14, Post Code 16344, Ilioupoli - Athens, Greece T.: +30 211 760 1300 F.: +30 211 176 9999 M.: +30 6982 550 850 e-mail: dimitris.sakellarios @telesuite.gr url: http://www.telesuite.gr _____ From: pgsql-php-owner@postgresql.org [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Archana K N Sent: Monday, April 30, 2012 6:58 PM To: pgsql-php@postgresql.org Subject: Re: [PHP] Cannot connect to remote postgres using php My postgres server is listening to same port . I tried changing both but same error is showing. I restarted the servers after changing the conf files. pgadmin3 is running on both servers and i can connect them remotely. I am able to connect to local host using the php code. I think i have changed the files correctly , some antivirus softwares are running in the system i dont know whether that causes the problem. -- ------------------- regards archana -------------------- ------=_NextPart_000_00E2_01CD2709.1E58FDF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

First of all set all firewall down and then = test again.

 

I remember you said that the PHP server and = the PGSQL server are on different machines? Is that = correct?

 

If so how did you succeed to connect to local = host? Did you move your PHP code to the same machine hosting your PGSQL server = or do you host a PGSQL server on both machines?

 

Provide some more details (a small design) to = give more help else it is hopeless like that sorry. Also provide the the part = of the PHP you try to create the connection.

 

Try the below = proposal.

 

On server that host the PHP = (IP=3Dy.y.y.y)

 

<?php

….

pg_connect("host=3Dx.x.x.x port=3D5432 = dbname=3DAAAAAAA user=3DBBBBBBBB password=3DBBBBBBBB") or die('Could not connect: ' = . pg_last_error());

….

?>

 

On server that host PGSQL = (IP=3Dx.x.x.x)

 

Inside = pg_hba.conf

 

…

hostnossl    all         all         0.0.0.0/0          = trust

….

 

Inside = postgresql.conf

 

listen_addresses =3D = 'x.x.x.x,localhost'

port =3D 5432

 

Test and report.

 

BR,

 

 

Sakellarios = Dimitris

Telesuite ltd Telecommunication and Internet Services

Address : T. Sofouli 14, Post Code 16344, Ilioupoli = - Athens, Greece

T= .: +30 211 760 1300 F.: +30 211 176 9999 = M.: +30 6982 550 850 = e-mail: dimitris.sakellarios@telesuite.gr  = url: http://www.telesuite.gr


From: pgsql-php-owner@postgresql.org [mailto:pgsql-php-owner@postgresql.org] = On Behalf Of Archana K N
Sent: Monday, April 30, = 2012 6:58 PM
To: = pgsql-php@postgresql.org
Subject: Re: [PHP] Cannot = connect to remote postgres using php

 

My postgres server is listening to same port . I tried changing = both but same error is showing. 

 

I restarted the servers after changing the conf files. pgadmin3 = is running on both servers and i can connect them remotely. I am able to = connect to local host using the php code.

 

I think i have changed the files correctly , some antivirus = softwares are running in the system i dont know whether that causes the = problem.

 

--
-------------------
regards
archana
--------------------

------=_NextPart_000_00E2_01CD2709.1E58FDF0--