Laravel - 使用 sqlite 找不到驱动程序异常

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44344853/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 16:04:37  来源:igfitidea点击:

Laravel - Could not find driver exception with sqlite

phplaravelsqlite

提问by Gandom

I'm using Laravelon Ubuntu 17.4. When I type this command: php artisan migrate:refreshI get the following issue:

我在Ubuntu 17.4上使用Laravel。当我键入此命令时:出现以下问题:php artisan migrate:refresh

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

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

I tried to install sqlite driver by running sudo apt-get install php7.1-sqlite3but I got the following issue:

我尝试通过运行安装 sqlite 驱动程序,sudo apt-get install php7.1-sqlite3但出现以下问题:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1-sqlite3
E: Couldn't find any package by glob 'php7.1-sqlite3'
E: Couldn't find any package by regex 'php7.1-sqlite3'.

读取包列表...完成
构建依赖树
读取状态信息...完成
E:无法定位包 php7.1-sqlite3
E:找不到任何包 glob 'php7.1-sqlite3'
E:找不到通过正则表达式“php7.1-sqlite3”找到任何包。

Also my php version is: PHP 7.1.5-1+deb.sury.org~yakkety+2.

我的 php 版本也是:PHP 7.1.5-1+deb.sury.org~yakkety+2.

回答by goodnesskay

Are you sure your Sqlite configurations have been set well? Because I had the same issue on my Ubuntu 17.04 and it was solved with

你确定你的 Sqlite 配置已经设置好了吗?因为我在我的 Ubuntu 17.04 上遇到了同样的问题,并且解决了

sudo apt-get install php7.1-sqlite3

Can I know how you configured your sqlite?

我能知道你是如何配置你的sqlite的吗?