سؤال

I've recently been given the job to move a website from one server to another. This site uses the Cake PHP framework (disclaimer: I've never used Cake before). After I copied all databases and files I am having trouble getting the site to load. It is giving the following error:

Fatal error: Class 'Router' not found in /sitepath/cake/dispatcher.php on line 283

The following code is on line 283: $namedExpressions = Router::getNamedExpressions();

From what I read this error is occurring because App::import('Core', array('Router', 'Controller'));, which is in the same file, is not working correctly. In fact if I var_dump() the App::import line I can see that it returns false. So I can only assume App::import should not be returning false, right? I'm guessing my problem is that something is configured wrong in the Cake config settings, maybe a default path? The only thing I've really changed in the config settings is the database credentials, I've updated them for the new database on the new server. So if someone could point me in the right direction and let me know if I have something configured wrong that would be great. Thanks.

Also, I should note this is using Cake 1.3.

هل كانت مفيدة؟

المحلول

/app/tmp/cache/persistent

This directory contains a bunch of files, one of the files is:

cake_core_core_paths

This file contains a serialized array with information that is automatically "cached" in this file. Some of that information includes default paths. When I initially opened this file I could see some of my default paths were set to the old server. Once I deleted this file, then refreshed the page, a new file was created with the correct paths and everything worked as expected. So basically the problem was App::import could not load the correct file because it was using the wrong file path.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top