我在localhost上运行我的CakePHP项目。当我填写表格,点击提交按钮后显示以下错误:数据源丢失
Missing Datasource Configuration
Error: The datasource configuration Array was not found in database.php.
我其实是一个数据源配置它,它看起来像:
类DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'arwinder',
'password' => 'root',
'database' => 'sh_db',
'prefix' => '',
//'encoding' => 'utf8',
);
public $test = array(
'datasource' => 'Database/Postgres',
'persistent' => false,
'host' => 'localhost',
'login' => 'arwinder',
'password' => 'root',
'database' => 'sh_db',
'prefix' => '',
//'encoding' => 'utf8',
);
} 。 ..但它被忽略。
其实我配置它,它看起来像: 公共$默认=阵列( \t \t '数据源'=>'数据库/ Postgres的, \t \t '执着'=>假, \t \t '主机'= > '本地主机', \t \t '登录'=> 'arwinder', \t \t '密码'=> '根', \t \t '数据库'=> 'sh_db', \t \t '前缀'=>' ', \t \t //'encoding'=>'utf8', \t); 但它被忽略。 – 2013-02-25 17:31:44
请使用您问题下方的“编辑”链接。 – 2013-02-25 17:32:45
请告诉我解决方案。 – 2013-02-25 17:40:57