console.php と main.php の両方の config フォルダー内
私は使っている:
'db'=>array(
'connectionString' => 'sqlite:protected/data/qdr.sqlite',
),
sqlite db は data フォルダーにあります。
モデルユーザーを作成しようとしているとき(usersという名前のテーブルがあります)
コマンド yiic shell model users で
エラーが表示されています:
>> model users
exception 'CDbException' with message 'CDbConnection failed to open the DB conne
ction: SQLSTATE[HY000] [14] unable to open database file' in F:\wamp\www\qdr\fra
mework\db\CDbConnection.php:381
Stack trace:
#0 F:\wamp\www\qdr\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 F:\wamp\www\qdr\framework\db\CDbConnection.php(308): CDbConnection->setActive
(true)
#2 F:\wamp\www\qdr\framework\base\CModule.php(387): CDbConnection->init()
#3 F:\wamp\www\qdr\framework\base\CApplication.php(438): CModule->getComponent('
db')
#4 F:\wamp\www\qdr\framework\cli\commands\shell\ModelCommand.php(259): CApplicat
ion->getDb()
#5 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(128): ModelCommand->r
un(Array)
#6 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(99): ShellCommand->ru
nShell()
#7 F:\wamp\www\qdr\framework\console\CConsoleCommandRunner.php(67): ShellCommand
->run(Array)
#8 F:\wamp\www\qdr\framework\console\CConsoleApplication.php(91): CConsoleComman
dRunner->run(Array)
#9 F:\wamp\www\qdr\framework\base\CApplication.php(169): CConsoleApplication->pr
ocessRequest()
#10 F:\wamp\www\qdr\framework\yiic.php(33): CApplication->run()
#11 F:\wamp\www\qdr\framework\yiic(14): require_once('F:\wamp\www\qdr...')
#12 {main}
>> model users
exception 'CDbException' with message 'CDbConnection failed to open the DB conne
ction: SQLSTATE[HY000] [14] unable to open database file' in F:\wamp\www\qdr\fra
mework\db\CDbConnection.php:381
Stack trace:
#0 F:\wamp\www\qdr\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 F:\wamp\www\qdr\framework\db\CDbConnection.php(308): CDbConnection->setActive
(true)
#2 F:\wamp\www\qdr\framework\base\CModule.php(387): CDbConnection->init()
#3 F:\wamp\www\qdr\framework\base\CApplication.php(438): CModule->getComponent('
db')
#4 F:\wamp\www\qdr\framework\cli\commands\shell\ModelCommand.php(259): CApplicat
ion->getDb()
#5 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(128): ModelCommand->r
un(Array)
#6 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(99): ShellCommand->ru
nShell()
#7 F:\wamp\www\qdr\framework\console\CConsoleCommandRunner.php(67): ShellCommand
->run(Array)
#8 F:\wamp\www\qdr\framework\console\CConsoleApplication.php(91): CConsoleComman
dRunner->run(Array)
#9 F:\wamp\www\qdr\framework\base\CApplication.php(169): CConsoleApplication->pr
ocessRequest()
#10 F:\wamp\www\qdr\framework\yiic.php(33): CApplication->run()
#11 F:\wamp\www\qdr\framework\yiic(14): require_once('F:\wamp\www\qdr...')
#12 {main}
>> model users
exception 'CDbException' with message 'CDbConnection failed to open the DB conne
ction: SQLSTATE[HY000] [14] unable to open database file' in F:\wamp\www\qdr\fra
mework\db\CDbConnection.php:381
Stack trace:
#0 F:\wamp\www\qdr\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 F:\wamp\www\qdr\framework\db\CDbConnection.php(308): CDbConnection->setActive
(true)
#2 F:\wamp\www\qdr\framework\base\CModule.php(387): CDbConnection->init()
#3 F:\wamp\www\qdr\framework\base\CApplication.php(438): CModule->getComponent('
db')
#4 F:\wamp\www\qdr\framework\cli\commands\shell\ModelCommand.php(259): CApplicat
ion->getDb()
#5 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(128): ModelCommand->r
un(Array)
#6 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(99): ShellCommand->ru
nShell()
#7 F:\wamp\www\qdr\framework\console\CConsoleCommandRunner.php(67): ShellCommand
->run(Array)
#8 F:\wamp\www\qdr\framework\console\CConsoleApplication.php(91): CConsoleComman
dRunner->run(Array)
#9 F:\wamp\www\qdr\framework\base\CApplication.php(169): CConsoleApplication->pr
ocessRequest()
#10 F:\wamp\www\qdr\framework\yiic.php(33): CApplication->run()
#11 F:\wamp\www\qdr\framework\yiic(14): require_once('F:\wamp\www\qdr...')
#12 {main}
>> model users > test.txt
exception 'CDbException' with message 'CDbConnection failed to open the DB conne
ction: SQLSTATE[HY000] [14] unable to open database file' in F:\wamp\www\qdr\fra
mework\db\CDbConnection.php:381
Stack trace:
#0 F:\wamp\www\qdr\framework\db\CDbConnection.php(330): CDbConnection->open()
#1 F:\wamp\www\qdr\framework\db\CDbConnection.php(308): CDbConnection->setActive
(true)
#2 F:\wamp\www\qdr\framework\base\CModule.php(387): CDbConnection->init()
#3 F:\wamp\www\qdr\framework\base\CApplication.php(438): CModule->getComponent('
db')
#4 F:\wamp\www\qdr\framework\cli\commands\shell\ModelCommand.php(259): CApplicat
ion->getDb()
#5 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(128): ModelCommand->r
un(Array)
#6 F:\wamp\www\qdr\framework\cli\commands\ShellCommand.php(99): ShellCommand->ru
nShell()
#7 F:\wamp\www\qdr\framework\console\CConsoleCommandRunner.php(67): ShellCommand
->run(Array)
#8 F:\wamp\www\qdr\framework\console\CConsoleApplication.php(91): CConsoleComman
dRunner->run(Array)
#9 F:\wamp\www\qdr\framework\base\CApplication.php(169): CConsoleApplication->pr
ocessRequest()
#10 F:\wamp\www\qdr\framework\yiic.php(33): CApplication->run()
#11 F:\wamp\www\qdr\framework\yiic(14): require_once('F:\wamp\www\qdr...')
#12 {main}
どうしよう、ここで何が悪いの?