pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dimitris Sakellarios <dimitris.sakellarios@telesuite.gr>
To: 'Archana K N' <archanakknn@gmail.com>
To: pgsql-php@postgresql.org
Subject: Re: Cannot connect to remote postgres using php
Date: Mon, 30 Apr 2012 11:40:37 +0300
Message-ID: <78A8EE7180F64BB9B80731343DC27C2D@toshiba> (raw)
In-Reply-To: <CACa6=i3GUa7gi0S1p6XiJ0FfBpkEKfoKn2ziCdQAzQLgyGmhpw@mail.gmail.com>
References: <CACa6=i3GUa7gi0S1p6XiJ0FfBpkEKfoKn2ziCdQAzQLgyGmhpw@mail.gmail.com>

Dear Archana hi,

 

Follow below:

 

Step0 

Make sure you have no firewall between you (php server root ip) and the
server that blocks requests.

 

If this is OK then:

 

Step1    

Inside postgresql.conf make sure you have set the listen IP and listen port
of your server and this will be the port you connect with php pg_connect

 

Step2

Inside pg_hda.conf configure the hosts you will allow connection either as
trusted or md5

 

Typically bellow will allow all to connect

 

hostnossl    all         all         0.0.0.0/0          trust

 

Below will allow all to connect using username and password (but before have
the first rule enabled to create remotely the users)

 

hostnossl    all         all         0.0.0.0/0          md5

 

Step3    restart Pgsql server to grand the new setting.

 

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 <mailto:dimitris.sakellarios@telesuite.gr>
@telesuite.gr  url: http://www.telesuite.gr <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 11:30 AM
To: pgsql-php@postgresql.org
Subject: [PHP] Cannot connect to remote postgres using php

 


Hello,

       I am getting this error whenever I try to connect to remote computer.
"Warning: pg_connect(): Unable to connect to PostgreSQL server: could not
connect to server: Connection timed out (0x0000274C/10060) Is the server
running on host "10.162.19.3" and accepting TCP/IP connections on port 5432?
"
-- 
-------------------
regards
archana
--------------------

view thread (19+ messages)  latest in thread

Message-ID: <78A8EE7180F64BB9B80731343DC27C2D@toshiba>
Permalink:  ../78A8EE7180F64BB9B80731343DC27C2D@toshiba/
Also on:    postgresql.org/message-id/78A8EE7180F64BB9B80731343DC27C2D@toshiba

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dimitris.sakellarios@telesuite.gr, archanakknn@gmail.com
  Subject: Re: Cannot connect to remote postgres using php
  In-Reply-To: <78A8EE7180F64BB9B80731343DC27C2D@toshiba>
  References: <CACa6=i3GUa7gi0S1p6XiJ0FfBpkEKfoKn2ziCdQAzQLgyGmhpw@mail.gmail.com> <78A8EE7180F64BB9B80731343DC27C2D@toshiba>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox