title: How to connect to Heroku postgres database from a local connection in php
body: <p>I'm trying to access to my Heroku Postgres database from a php code that runs locally.</p>
  
  <pre><code>pg_connect("host=myhost port=5432 dbname=mydb user=me password=*** sslmode=require options='--client_encoding=UTF8'")
  </code></pre>
  
  <p>works well when the code runs on Heroku, but not locally. (the value are those given by Heroku)</p>
  
  <p>I get this error :</p>
  
  <blockquote>
    <p>Unable to connect to PostgreSQL server: sslmode value "require"
    invalid when SSL support is not compiled in</p>
  </blockquote>
  
  <p>If I delete sslmode, I get this error :</p>
  
  <blockquote>
    <p>Network is unreachable Is the server running on host "myhost" and
    accepting TCP/IP connections on port 5432?</p>
  </blockquote>
  
  <p>Does someone has a clue ? It would help a lot !</p>