php – QueryException Laravel : Driver not found-ThrowExceptions

Exception or error:

I am facing a strange error with laravel under ubuntu using PostgreSql.
Its NOT a PDOException. The database migration is successful so all driver are set and PDO connection is also established. But why this error?

Didn’t find much about it in google. I am attaching the screenshot.

This is NOT homestead rather own lamp stack.
enter image description here

Edit:
There is no problem even with tinker
enter image description here

Regards

How to solve:

I resolved this issue using the following command:-

sudo apt install php7.4-pgsql (replace 7.4 with your php version)

To check PHP version use: php -v

For more info visit: https://www.php.net/manual/en/pgsql.installation.php

Please check php info and serach “PDO Driver for PostgreSQL” or “pdo_pgsql” after run the above command

keywords :- for pgadmin, pgsql, postgresql, PDO Driver for PostgreSQL, pdo_pgsql @vasimraja

Answer´╝Ü

Please check the default key in app/config/database.php

For postgres, default should be 'default' => 'postgres',

Leave a Reply

Your email address will not be published. Required fields are marked *