0
I have Postgres 9.3 installed on a Windows server 2012. I need to collect BD information for a website. I’ve already set up the network router forwarding port 5432.
On pg_hba I changed the line: host all all 0.0.0.0/0 md5
In postgresql I put the line: listen_addresses = '*'
On a remote PC I can connect the pgAdminIII to the database.
On the site, using php I tried to call using:
$liga = "host=xxxxx.no-ip.net port=5432 dbname=gwrcsg01f1 user=postgres password=xxxxxxx";
$conn = pg_connect($liga) or die('Falha de ligacao ao servidor');
$result = pg_query($conn , "SELECT * FROM clientes;");
$registo = pg_fetch_array($result);
pg_close();
I always get 'Server connection failure'. Connecting to a local website BD works. I don’t know if it’s relevant but the site is php 5.4 and I also tried 5.6.
Anyone can help?
By remote pc you connect using this address
host=xxxxx.no-ip.net port=5432
?– NoobSaibot
Yes. I use the same data
– p9adi