Lists: | pgsql-php |
---|
From: | "Dimitris Sakellarios" <dimitris(dot)sakellarios(at)telesuite(dot)gr> |
---|---|
To: | <archanakknn(at)gmail(dot)com>, <pgsql-php(at)postgresql(dot)org> |
Subject: | Re: Cannot connect to remote postgres using php |
Date: | 2012-04-30 16:40:36 |
Message-ID: | PostgreSQL : Re : 범퍼카 토토를 사용하여 원격 포스트 그레에 |
Views: | Raw Message | PostgreSQL : | Download mbox | Resend email |
Lists: | pgsql-php |
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)
<?php
..
pg_connect("host=x.x.x.x port=5432 dbname=AAAAAAA user=BBBBBBBB
password=BBBBBBBB") or die('Could not connect: ' . pg_last_error());
..
?>
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 <mailto:dimitris(dot)sakellarios(at)telesuite(dot)gr>
@telesuite.gr url: http://www.telesuite.gr <http://www.telesuite.gr/>
_____
From: pgsql-php-owner(at)postgresql(dot)org [mailto:pgsql-php-owner(at)postgresql(dot)org]
On Behalf Of Archana K N
Sent: Monday, April 30, 2012 6:58 PM
To: pgsql-php(at)postgresql(dot)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
--------------------
From: | Archana K N <archanakknn(at)gmail(dot)com> |
---|---|
To: | Dimitris Sakellarios <dimitris(dot)sakellarios(at)telesuite(dot)gr> |
Cc: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: Cannot connect to remote postgres using php |
Date: | 2012-04-30 18:10:33 |
Message-ID: | CACa6=i0-OoXeH-AXq0Xje2KC6w0_HuRFwU4fa6KP7T-vamAwSQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-php |
I host pgsql servers on both machines.
>
> the pph code is like this
'
$conn=pg_connect("host=10.162.19.3 port=5432 dbname=postgres user=postgres
password=postgresql");
'
--
-------------------
regards
archana
--------------------
From: | Sven Marcel Buchholz <sven(at)is-buchholz(dot)com> |
---|---|
To: | pgsql-php(at)postgresql(dot)org |
Subject: | Re: Cannot connect to remote postgres using php |
Date: | 2012-04-30 18:19:09 |
Message-ID: | 4F9ED79D.2060709@is-buchholz.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg스포츠 토토 베트맨SQL : Postg스포츠 토토 베트맨SQL 메일 링리스트 : 2012-04-30 이후 PGSQL-PHP 18:19 |
On 30.04.12 20:10, Archana K N wrote:
>
>
> I host pgsql servers on both machines.
>
> the pph code is like this
>
>
>
> '
>
> $conn=pg_connect("host=10.162.19.3 port=5432 dbname=postgres
> user=postgres password=postgresql");
>
> '
>
>
>
> --
> -------------------
> regards
> archana
> --------------------
Hallo,
your firewall accepts requests for the IP 10.162.19.3 on port 5432?
Kind regards
Sven