在CAKEPHP的database.php.default
中将database.php
重命名为\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\
文件时,它不存在
相反,我在database.php.default
和\app\Config\
\lib\Cake\Console\Templates\skel\Config
当我将database.php.default
重命名为database.php
时,它仍然会给我一个错误。
我如何需要连接到数据库和下一个程序继续。
答案 0 :(得分:2)
将配置文件从\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',
);
}