Cake PHP Fatal Error (256)

2019-02-15 11:35发布

问题:

I have just created an application using cake bake and when I run it I get the screen that says 'Sweet, myApp got baked' but there are no styling on it and at the bottom I get the following error:

Fatal Error (256): ConnectionManager::getDataSource - Non-existent data source default [CORE\cake\libs\model\connection_manager.php, line 102]

I've configure my database and user etc. But I don't understood what's going on.

Can anyone help please?

回答1:

You likely entered a name for Cake's bake wizard. Replace that name in app/config/database.php with "$default" Thus,

var $blog = array(...);

becomes

var $default = array(...);


回答2:

I've just fixed similar bug on my site. Check if all tables in the DB are there. My problem was missing table after db import . Good luck :)