title: Cannot connect to PgSQL via Laravel SQLSTATE[08006] [7] FATAL
body: <p>I'm trying to connect to pgsql via laravel and finally got everything setup (pgsql server running, pdo installed, all libs installed). I'm running on a VPS (CentOS) managed via CPanel/WHM.</p>
  
  <p>Here's what I'm doing:
  I'm trying to create a user database via artisan (Laravel's command line) using migrate:install.</p>
  
  <p>For those that don't use Laravel, artisan uses php's PDO for pgsql to connect. Here are my settings:</p>
  
  <pre><code>    'pgsql' =&gt; array(
          'driver'   =&gt; 'pgsql',
          'host'     =&gt; 'localhost',
          'database' =&gt; 'dbname',
          'username' =&gt; 'username',
          'password' =&gt; 'password',
          'charset'  =&gt; 'utf8',
          'prefix'   =&gt; '',
      ),
  </code></pre>
  
  <p>I've also setup a test.php file:</p>
  
  <pre><code>$dbconn = pg_connect("host=localhost port=5432 dbname=dbname user=username password=password");
  </code></pre>
  
  <p>which also fails. I used phpPgAdmin to see what's up and all of the permissions are set correctly, the database shows up, the username is correct, same with password. I checked where postgre (version 8.4.12 btw) was running and phpPgAdmin tells me "localhost:5432". </p>
  
  <p>The error I get via the command line is the following: </p>
  
  <pre><code>SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry for host "::1", user "myusername", database "my_database", SSL OFF
  </code></pre>
  
  <p>Now, I tried to find the pg_hba.conf file but I'm not entirely sure where to look for it. Same goes for the error/access logs for pg and google hasn't been any help as far as this goes. </p>
  
  <p>Any idea on what I can do?</p>