I'm getting the "Driver not found" PDO exception when trying to connect to PostgreSQL DB and I can't seem to figure out what's happening. Here are system specs:
WampServer Version 3.0.3 64bit
PHP 7.1.10
Apache 2.4.9
Laravel 5.5
I downloaded PosgtreSQL 10 (Windows x86-64) from here - EnterpriseDB
Here are all the relevant screenshots:
extension_loaded('pgsql')
returns true
The only discrepancy that I see is that I downloaded PostgreSQL 10, and PHP Info says PostgreSQL(libpq) Version is 9.6.2. Could that be an issue?
EDIT:
I replaced PostgreSQL 10 with 9.6.5 (which is the only available 9.6 version), and it didn't fix the issue.
EDIT 2:
$dbh = new PDO("pgsql:dbname=laravel_admin_api;host=127.0.0.1", "postgres", "admin");
echo $dbh ? "connected" : "failed";
returns connected
. So it's gotta be a Laravel issue?
EDIT 3:
Ok, so the connection to the database works, I created a table and inserted a row manually through pgAdmin, and then called
\App\User::all()->toArray()
and that worked. So it's actually php artisan migrate
that's having issues, and throwing the could not find driver
exception. Still stumped on that one.