私はこのチュートリアルに従っています。
実行php scripts/load.mysql.php
すると、次のように表示されます。
SQLSTATE[42000] [1102] 正しくないデータベース名 '/home/tirengarfio/workspace/ZendFW/gaziende/application/../data/db/guestbook-dev.db'
だから私はちょうど行を変更しようとしました
resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook-dev.db"
に
resources.db.params.dbname = "guestbook-dev" and created a new database called guestbook.
しかし、「ゲストブック」がファイルではないという別のエラーが表示されます。
PHP 警告: file_get_contents(/home/tirengarfio/workspace/ZendFW/gaziende/scripts/data.mysql.sql): ストリームのオープンに失敗しました: /home/tirengarfio/workspace/ZendFW/gaziende/scripts/load にそのようなファイルまたはディレクトリはありません81 行目の .mysql.php
これは 81 行目のエラーの周りのコードです (var_dump() が返すものを確認してください):
// Check to see if we have a database file already
$options = $bootstrap->getOption('resources');
$dbFile = $options['db']['params']['dbname'];
if (file_exists($dbFile)) {
unlink($dbFile);
}
// this block executes the actual statements that were loaded from
// the schema file.
try {
$schemaSql = file_get_contents(dirname(__FILE__) . '/schema.mysql.sql');
// use the connection directly to load sql in batches
$dbAdapter->getConnection()->exec($schemaSql);
var_dump($dbFile);die(); // this returns "guestbook-dev"
chmod($dbFile, 0666);
では、データベース接続の名前を正確に設定するにはどうすればよいですか?
注: チュートリアルの例は Sqlite 用であり、MySQL を使用しようとしています。その点ですか?私はSqliteを使用したことがありません。
よろしく