I'm trying to connect to the PostgreSQL database of my app on Heroku:
$host = "ec2-54-235-242-31.compute-1.amazonaws.com";
$username = "user";
$password = "pass";
$database = "dbname";
$port = "5432";
$dbconn = pg_connect("host=".$host." port=".$port
." dbname=".$database." user=".$username." password=".$password)
or die('Could not connect: ' . pg_last_error());
but I'm getting this error:
Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "69.196.177.196", user "user", database "dbname", SSL off in D:\wamp\www\heroku_app\test.php on line 53
What is the problem here? How can I fix it?
Note: this only happens when I run on my local machine (via WAMP server). If I deploy it to Heroku then it runs fine