简体   繁体   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)

I'm using Laravel 8 and **Xampp (v3.2.4) - ** and configured phpunit.xml to run the tests on sqlite_testing (memory).我正在使用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:'
],

when i run./vendor/bin/phpunit --color --testdox i'm getting this error:当我运行时。/vendor/bin/phpunit --color --testdox 我收到此错误:

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

In order to solve this, i've tried:为了解决这个问题,我尝试过:

  • on php.ini uncomment extension=pdo_sqlite , extension=sqlite3 and fill the sqlite3.extension_dir = "C:\xampp\php\ext"在 php.ini 上取消注释extension=pdo_sqliteextension=sqlite3并填写sqlite3.extension_dir = "C:\xampp\php\ext"
  • copied c:\xampp\php\ext\libsqlite3.dll to C:\xampp\apache\bin将 c:\xampp\php\ext\libsqlite3.dll 复制到 C:\xampp\apache\bin
  • php artisan config:clear (after updating database.php) php 工匠配置:清除(更新 database.php 后)
  • composer update作曲家更新
  • composer require doctrine/dbal作曲家需要学说/dbal
  • checked php -m for PDO检查 PDO 的 php -m

Nothing worked.没有任何效果。 Still getting the error message:仍然收到错误消息:

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

Follow that steps.按照这些步骤。

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.

相关问题 如何解决在 laravel 中找不到驱动程序(SQL:select * from information_schema.tables where table_schema = my_app and table_name = settings)? - How to resolve 'could not find driver (SQL: select * from information_schema.tables where table_schema = my_app and table_name = settings) in laravel? Laravel Sail:找不到驱动程序(SQL:SHOW FULL TABLES WHERE table_type = 'BASE TABLE')--- Mac - Laravel Sail: could not find driver (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE') --- Mac 我尝试在 laravel 上使用 postgresql 但找不到驱动程序(SQL:select * 来自“用户”,其中“id”= 4 限制 1) - I tried using postgresql on laravel but got could not find driver (SQL: select * from “users” where “id” = 4 limit 1) Laravel 8 - 找不到驱动程序:Illuminate\Database\QueryException 找不到驱动程序(SQL:select * 来自“列表”) - Laravel 8 - Could not find driver : Illuminate\Database\QueryException could not find driver (SQL: select * from `list`) 连接被拒绝 SQL:select * from information_schema.tables where table_schema = firstdb and table_name = migrations and table_type = 'BASE TABLE - Connection refused SQL: select * from information_schema.tables where table_schema = firstdb and table_name = migrations and table_type = 'BASE TABLE 本地主机上的Laravel 5.4:QueryException找不到驱动程序(SQL:从session中选择* - Laravel 5.4 on localhost: QueryException could not find driver (SQL: select * from `sessions` Laravel - 无法使用sqlite找到驱动程序异常 - Laravel - Could not find driver exception with sqlite Xampp 无法与 Sqlite 连接:找不到驱动程序 - Xampp won't connect with Sqlite: could not find driver PDOException::(“找不到驱动程序”)Laravel和sql server - PDOException::(“could not find driver”) Laravel & sql server 找不到驱动程序-Laravel - Could not find driver - Laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM