CakePHP 2.1 doesn't work on localhost
I have deployed my application to a remote host and everything works as expected. But when I try to test my code on localhost it gives me the following error, without any changes to the code running on the host:
Fatal error: Class 'AppHelper' not found in [path]
I am using CakePHP 2.1 and MySQL as my default data source.
I am connecting to my local database as remote (with authentication changes):
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => 'database',
'prefix' => '',
'encoding' => 'utf8',
);
Why doesn't this work on my localhost? Thanks you
source to share
Two possible things, either you weren't aware of the AppHelper requirement for 2.1: http://book.cakephp.org/2.0/en/appendices/2-1-migration-guide.html
or you forget to declare the helper at the very top of your class:
App::uses('AppHelper', 'View/Helper');
Although the second option is unlikely if you are not using any unit tests. So my bet is first.
source to share