首页  >  问答  >  正文

Symfony 6 / Doctrine - 驱动程序发生异常:找不到驱动程序

我尝试设置我的 symfony 项目,一切都很好,因为我尝试创建学说数据库。 我在 .env 文件中写入了 DATABASE_URL,这是正确的,我想是这样,但是无论是我的本地 xampp 服务器还是我的 Web 服务器,都不起作用。

我总是遇到同样的错误:

[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


P粉729518806P粉729518806246 天前618

全部回复(1)我来回复

  • P粉198814372

    P粉1988143722024-01-22 14:18:57

    您可能尚未在 php.ini 文件中启用 pdo_mysql 扩展。 尝试取消注释 php.ini 中的 ;extension=pdo_mysql 行。

    请注意,您的 php 控制台可能使用与运行应用程序的文件不同的 php.ini 文件。

    回复
    0
  • 取消回复