繁体   English   中英

Laravel - xampp 找不到驱动程序(SQL:select * 来自 sqlite_master,其中 type = 'table' 和 name = migrations)

[英]Laravel - xampp could not find driver (SQL: select * from sqlite_master where type = 'table' and name = migrations)

我正在使用Laravel 8和 **Xampp (v3.2.4) - ** 并配置 phpunit.xml_ 在 sqlite 上运行测试。

<server name="DB_CONNECTION" value="sqlite_testing"/>
<server name="DB_DATABASE" value=":memory:"/>

database.php
'sqlite_testing' => [
  'driver' => 'sqlite',
  'database' => ':memory:'
],

当我运行时。/vendor/bin/phpunit --color --testdox 我收到此错误:

  • Illuminate\Database\QueryException: 找不到驱动程序 (SQL: select * from sqlite_master where type = 'table' and name = migrations)

为了解决这个问题,我尝试过:

  • 在 php.ini 上取消注释extension=pdo_sqliteextension=sqlite3并填写sqlite3.extension_dir = "C:\xampp\php\ext"
  • 将 c:\xampp\php\ext\libsqlite3.dll 复制到 C:\xampp\apache\bin
  • php 工匠配置:清除(更新 database.php 后)
  • 作曲家更新
  • 作曲家需要学说/dbal
  • 检查 PDO 的 php -m

没有任何效果。 仍然收到错误消息:

   ├ Illuminate\Database\QueryException: could not find driver (SQL: select * from sqlite_master where type = 'table' and name = migrations)

按照这些步骤。

1 step: sudo apt install sqlite3
2 step: sudo apt-get install php7.4-sqlite3 -y
3 step: php -m | grep sqlite
4 step: .env

DB_CONNECTION=sqlite
DB_DATABASE={absolute_path}/database.sqlite
#DB_FOREIGN_KEYS=true
#DB_HOST=127.0.0.1
#DB_PORT=3306
#DB_DATABASE=homestead
#DB_USERNAME=homestead
#DB_PASSWORD=secret

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM