Home » Php » php – Symfony/PostGreSQL : An exception occurred in driver: could not find driver

php – Symfony/PostGreSQL : An exception occurred in driver: could not find driver

Posted by: admin February 25, 2020 Leave a comment

Questions:

i’m using Symfony 4.3.4 with a PostGreSQL server version 12.1, and i have some difficulties to connect my project to the database.

I edited the .env file like that :

DATABASE_URL=postgresql://user:[email protected]:5432/database?serverVersion=12.1&charset=utf8

After that i tried to make migrations, but i had an error because of php extensions.
So i added this to the php.ini file : (i’m using WAMP with PHP 7.2.18)

extension=pdo_pgsql
extension=pgsql

After that, i was able to make migrations.
My problem is, when i try to register a new account in my app, it returns me the error :

An exception occurred in driver: could not find driver | in AbstractPostgreSQLDriver.php.

And i have this problem with all routes that interact with my tables
I don’t understand why i am able to make migrations, but i can’t do anything else.

Thanks you for the help.

How to&Answers: