Can you make sure that pdo_pgsql extension is enabled in your php configuration?
The extension pgsql is not the pdo driver and you can keep it only if you have some legacy apps requiring it.
Laravel Can't Connect to Postgresql
Hi,
When I try to connect postgresql server in my computer with Laravel I get "PDOException with message 'could not find driver'" error. I am getting this error when I run DB::connection()->getPdo(); command at artisan tinker. (If I run php artisan migrate command, the error is Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE'))
When I write a simple PHP code, I can connect to postgresql db by the way. This means the problem is not about my PHP or Postgresql installations. I am also able to connect to MySQL and SQLite with Laravel. So it seems the problem is about Laravel-PostgreSQL pair.
My configuration is below:
Windows 10
Wamp Server 3.1.4
Apache 2.4.35
PHP 7.2.10
Laravel Framework 6.0.3
Related lines of Laravel .env file:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=laravel_dnm1
DB_USERNAME=postgres
DB_PASSWORD=mrd.BE.265
Please or to participate in this conversation.