dongye6377 2012-06-04 07:17
浏览 68
已采纳

在CAKEPHP中将`database.php.default`重命名为`database.php`在`\ app \ Config \`中会出错

Renaming database.php.default to database.phpin \app\Config\ in CAKEPHP gives Error

I have installed a fresh copy of CAKEPHP 2.1.3 on XAMPP with Windows 7 and i have got an error

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]

When i look into for database.php file in \app\config\ its not present

Instead, i found database.php.default in \app\Config\ and \lib\Cake\Console\Templates\skel\Config

And when i rename the database.php.default to database.php, it still gives me an error. How do i need to connect to database and next procedure to go ahead.

  • 写回答

1条回答 默认 最新

  • dongrao9454 2012-06-04 07:19
    关注

    Move config file from \lib\Cake\Console\Templates\skel\Config to D:\xampp\htdocs\cakephp\example\app\Config\

    Or create new one with contents:

    class DATABASE_CONFIG {
    
        public $default = array(
            'datasource' => 'Database/Mysql',
            'persistent' => false,
            'host' => 'localhost',
            'login' => 'username',
            'password' => 'password',
            'database' => 'databas name',
            'prefix' => '',
            //'encoding' => 'utf8',
        );
    
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿