title: Heroku Postgres Connection from localhost PHP application
body: <p>Is there anyway to connect to the Heroku postgres (Free) db instance from a locally running PHP application.  I am able to get pgAdminIII successfully connected, but no luck through application connection string connecting to the same Db?</p>
  
  <p>Connection</p>
  
  <pre><code>$dbconn = pg_connect("host=xxxxxx.compute-1.amazonaws.com port=5432 dbname=xxxxxxx user=xxxxxx password=xxxxxx sslmode=require options='--client_encoding=UTF8'");
  </code></pre>
  
  <p>Error Thrown from PHP Code:</p>
  
  <pre><code> Warning: pg_connect(): Unable to connect to PostgreSQL server: sslmode value &amp;quot;require&amp;quot; invalid when SSL support is not compiled in in 
  </code></pre>
  
  <p>I found the following on Heroku's site but I am hoping someone can clarify whether I'm dealing with a postgres php issue (running PHP on Apache, PHP 5.3 on Mac OS X Lion 10.7.4) or if this is just an environment restriction as indicated in Heroku's following statement:</p>
  
  <blockquote>
    <p>How do I connect to Heroku Postgres? Databases on Heroku Postgres
    accept standard PostgreSQL connections. Connections can be made from
    PostgreSQL client applications (such as psql, or PGAdmin), Application
    Frameworks (such as Ruby-on-Rails or Django), or any other libpq
    compatible client, from anywhere over SSL.</p>
    
    <p>Shared databases however, can only be connected to from applications
    running on Heroku.</p>
  </blockquote>
  
  <p>Can someone also explain why pgAdminIII is able to connect but my application cannont?</p>
  
  <p>Thank you.</p>
  
  <p>Further Findings:
  PHPINFO-></p>
  
  <ul>
  <li>OpenSSL support  enabled </li>
  <li>OpenSSL Library Version  OpenSSL 0.9.8r 8 Feb
  2011</li>
  <li><p>OpenSSL Header Version   OpenSSL 0.9.8r 8 Feb 2011</p></li>
  <li><p>PostgreSQL Support   enabled</p></li>
  <li>PostgreSQL(libpq) Version    8.2.23</li>
  <li><em><strong>SSL support   disabled</em></strong></li>
  </ul>