簡體   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