0

i'm new here and I apologize if I'm doing something wrong for post my question.

My question is quite simple: From my machine I can connect pgAdmin III to a remote postgreSql (provide by Heroku). I can read/write my database without problems.

Unfortunately, from the same machine, I can't connect a PHP page using PDO extension (it work perfectly). The error it give to me is:

SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry for host "x.x.x.x", user "username", database "myDatabase", SSL off

I should edit "pg_hba.conf" for resolve, but unfortunately I can't edit it on Heroku (or maybe I don't know how to do).

I don't understand why pgAdmin III can connect but my PHP page can't.

Thanks in advance.

  • Welcome to Stackoverflow! First of all, please read the [tour](http://stackoverflow.com/tour). Next, you want to read [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) and edit your question accordingly. – Markus W Mahlberg Dec 16 '14 at 10:21

1 Answers1

0

You will get your ans in the following ans I think your user have no entry in pg_hba.conf file and your pgAdmin III and PHP users are different check the link

Community
  • 1
  • 1
smn_onrocks
  • 1,282
  • 1
  • 18
  • 33
  • My error was I forgot "sslmode=require" in my connection string. Now error is "sslmode value 'require' invalid when SSL support is not compiled in". OpenSSl is installed. What is wrong? – El Mander Dec 16 '14 at 15:03
  • @ElMander Your comment is not clearly understood by me. will you give some more details. – smn_onrocks Dec 16 '14 at 15:45