在 CAKEPHP 中的 'appConfig' 中将 'database.php.default' 重命名


Renaming `database.php.default` to `database.php`in `appConfig` in CAKEPHP gives Error

CAKEPHP 中将database.php.default重命名为 database.php in 'app'Config' 会给出错误

我已经在装有

Windows 7 的 XAMPP 上安装了 CAKEPHP 2.1.3 的新副本,但出现错误

Warning (2): include_once(D:'xampp'htdocs'cakephp'example'app'Config'database.php) [function.include-once]: failed to open stream: No such file or directory [CORE'Cake'Model'ConnectionManager.php, line 68]

Warning (2): include_once() [function.include]: Failed opening 'D:'xampp'htdocs'cakephp'example'app'Config'database.php' for inclusion (include_path='D:'xampp'htdocs'cakephp'example'lib;.;D:'xampp'php'PEAR') [CORE'Cake'Model'ConnectionManager.php, line 68]

当我查看database.php文件时'app'config'它不存在

相反,我在'app'Config''lib'Cake'Console'Templates'skel'Config中找到了database.php.default

当我将database.php.default重命名为 database.php 时,它仍然给我一个错误。我需要如何连接到数据库和下一个过程才能继续。

将配置文件从'lib'Cake'Console'Templates'skel'Config移动到D:'xampp'htdocs'cakephp'example'app'Config'

或者创建一个包含以下内容的新内容:

class DATABASE_CONFIG {
    public $default = array(
        'datasource' => 'Database/Mysql',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'username',
        'password' => 'password',
        'database' => 'databas name',
        'prefix' => '',
        //'encoding' => 'utf8',
    );
}