LoginSignup
0
0

More than 5 years have passed since last update.

初めて使ったSQLiteで躓いたこと

Posted at

ことの始まり

今現在自身が公開していたサービスの再開発をしており、Laravel+Vue+Vuerouterでやっているのですが、開発の途中でテストを行ったところ躓きました。

躓いた箇所

APIの作成をしてartisanでテストをしたところ以下のようなエラーが出ました

console
$ ./vendor/bin/phpunit --testdox
PHPUnit 7.5.6 by Sebastian Bergmann and contributors.

Unit\Example
 ✔ Basic test

Feature\Example
 ✔ Basic test

Feature\RegisterApi
 ✘ Should 新しいユーザーを作成して返却する
/*中略*/
 Caused by
   │ PDOException: could not find driver
/*中略*/
ERRORS!
Tests: 3, Assertions: 2, Errors: 1.

ん?
ドライバが入ってない・・・
そりゃ初めてSQLiteを使ったんで入ってないですよね(^_^;)
ずっとMySQLを使っていて久しぶりに新しいDBMSを入れたので失念していました。

解決法

ドライバを入れましょう!

console
$ sudo apt install php-pdo-sqlite // SQLiteのPDOドライバをインストール
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0