title: Can't connect to postgreSQL database through php pdo driver
body: <p>I've decided to switch from MySQL to PostgreSQL recently, mostly just to learn a new DB.  It's been pretty painful, but I think I'm close.</p>
  
  <p>I'm using php and PDO, my PDO driver has been successfully install and configured.</p>
  
  <p>Opening my site, I get the error:</p>
  
  <pre><code>Connection failed: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "postgres"
  </code></pre>
  
  <p>I'm using the following connection calls (I've tried a few variations of calling user/pw in the $dsn variable, and in separate $user/$pass variables, and including port=5432):</p>
  
  <pre><code>$dsn  = 'pgsql:dbname=db1;host=localhost;user=postgres;password=pass';
  $db = new PDO($dsn);
  </code></pre>
  
  <p>Also, I'm able to log into my db from the command line:</p>
  
  <pre><code>$ su postgres
  </code></pre>
  
  <p>(pass)</p>
  
  <pre><code>$ psql db1
  </code></pre>
  
  <p>output: </p>
  
  <blockquote>
    <p>could not change directory to "/home/ec2-user" psql (8.4.9) Type
    "help" for help.</p>
    
    <p>db1=#</p>
  </blockquote>
  
  <p>Any ideas?  I'd love to provide more info if needed.</p>