Laravel 5 with Postgres SQL

Like @jeff said, this is probably caused by not setting DB_CONNECTION=pgsql in the .env-file. The .env-file has MySQL preconfigured, so you must edit this file.


I had the same problem with Laravel-WAMP-PostgreSql driver not found exception. I even successfully established direct connection to Postgre as you have, but with no luck with the "php artisan migrate" command.

After long research I found out that there are multiple php.ini files in which "extension=php_pdo_pgsql.dll" and "extension=php_pgsql.dll" are comented out.

The solution is (of course) to uncoment the extensions in the following files:

  • ~/wamp/bin/php/php5.5.*/php.ini
  • ~/wamp/bin/php/php5.5.*/phpForApache
  • ~/wamp/bin/php/php5.5.*/php.ini.install
  • ~/wamp/bin/php/php5.5.*/php.ini-development
  • ~/wamp/bin/php/php5.5.*/php.ini-production and
  • ~/wamp/bin/apache/apache2.4.9/php.ini

** You can leave off the "php.ini-development" and "php.ini-production" (don't need to uncoment these files).


As you said you already choosed Default Database as Postgres SQL

'default' => 'pgsql',

It is a must that you need to uncomment the pdo and postgres shared object in your php configuration settings (php.ini)

i.e., You need to uncomment the following lines in your php.ini

extension=pdo_pgsql.so
extension=pgsql.so

Note :

Don't forget to stop and start your apache after doing this changes (or php-fpm if using that instead).