Symfony 6 / Doctrine - An exception occurred in the driver: could not find driver

Viewed 1853

I tried to setup my symfony project, everything was well, since I tried to create the doctrine database. I written my DATABASE_URL in the .env file, that is correct, well I think so, but nothing works, either my local xampp server or my web server.

I get always the same error:

[critical] Error thrown while running command "doctrine:database:create". Message: "An exception occurred in the driver: could not find driver"


In ExceptionConverter.php line 119:

  An exception occurred in the driver: could not find driver


In Exception.php line 30:

  could not find driver


In Driver.php line 28:

  could not find driver
1 Answers

It looks like you may have not enabled the pdo_mysql extension in your php.ini file. Try to uncomment the ;extension=pdo_mysql line inside your php.ini.

Beware, your php console may use a different php.ini file than the one that runs your application.

Related