【问题标题】:Laravel - Getting [PDOException] could not find driverLaravel - 获取 [PDOException] 找不到驱动程序
【发布时间】:2017-05-29 20:36:04
【问题描述】:

我正在使用 Lampp apache 服务器,当我运行命令 php artisan migrate 时收到此错误消息:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_pdo_mysql.dll' - /usr/lib/php/20151012/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[Illuminate\Database\QueryException] could not find driver (SQL: select * from information_schema.tables where table_schema = seo-cms and table_name = migrations)
[PDOException] could not find driver 

我从php.ini/opt/lamp/etc/php.ini/etc/php/7.0/cli/php.ini 启用了pdo 扩展,我重新启动了服务器,但这还不够。很可能我错过了一些东西。你能帮我解决这个问题吗?

谢谢!

[更新]

【问题讨论】:

  • 为什么在使用 Linux 时需要 .dll?
  • @KoenHollander 我不明白你的问题,你能更具体一点吗?
  • 看,windows 使用 .dll 文件作为 PHP 驱动程序。您的错误消息指的是 .dll 文件。但是 linus 必须使用 .so 文件作为扩展名。
  • 我刚刚用phpinfo()的结果更新了我的帖子;
  • 通过执行这个:sudo apt-get install php-mysql。它解决了我的问题。谢谢

标签: php laravel pdo


【解决方案1】:

我执行了这个:sudo apt-get install php-mysql,它解决了我的问题。但我建议你放弃lampp 并使用apache service2。在lampp上安装和设置配置比较复杂

【讨论】:

    猜你喜欢
    • 2016-05-16
    • 1970-01-01
    • 2017-02-20
    • 2015-04-08
    • 2016-09-03
    • 2022-01-23
    相关资源
    最近更新 更多