LoginSignup
2
1

More than 5 years have passed since last update.

CakePHP3 備忘録 | debug_kitのSQLiteがコケる

Last updated at Posted at 2016-11-04

debug_kitのSQLiteがコケる

Win10+vagrant+winnfsdの固有の問題かもしれない。
SQLiteがクラッシュしてDisk/IOエラーが出る…。

SQLSTATE[HY000]: General error: 10 disk I/O error

エラーはアプリケーション本体ではなくdebug_kitが問題。
下記画像でSQLiteが怪しいことがわかる。

192.168.11.26-2016-11-04-20-03-52.png

tmp/debug_kit.sqliteを削除すると戻るのだがすぐ再発。
その場合には、ここにあるようにストレージにmysql等を利用すれば良い。

分かるとは思うが、キー'Datasources'の配下に設置。

/**
 * The debug_kit connection stores DebugKit meta-data.
 */
'debug_kit' => [
    'className' => 'Cake\Database\Connection',
    'driver' => 'Cake\Database\Driver\Mysql',
    'persistent' => false,
    'host' => 'localhost',
    //'port' => 'nonstandard_port_number',
    'username' => 'dbusername',    // Your DB username here
    'password' => 'dbpassword',    // Your DB password here
    'database' => 'debug_kit',
    'encoding' => 'utf8',
    'timezone' => 'UTC',
    'cacheMetadata' => true,
    'quoteIdentifiers' => false,
    //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
],

「テーブルは?」と思ったがSQLiteのときもdebug_kitが勝手に作っているはずなので、そのまま確認。本来的にはちゃんとドキュメントなどを確認したほうが良いのだと思う。
予想どおりテーブルはdebug_kitが作成してくれた。

2
1
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
2
1