PHP connect to different Server Database

522 Views Asked by At

I am trying to connect to different server database but I keep on getting the error message

$conn =  pg_pconnect("host=xx.xx.xxx.xxx port=5432 dbname=***** user=***** password=*****") or die ("Could Not Connect. Try again later: " . pg_last_error());

Can you please assist?

1

There are 1 best solutions below

0
On

I added this line "host all all 0.0.0.0/0 md5" in the pg_hba table and it worked. Thanks all