1

I recently moved a site from local to staging and when I go to the front end or the back end (CMS) it throws this error...

Unable to load the requested class: cache

Carl Crawley tried to help me via Twitter (https://twitter.com/madebymayo/status/476274119097733120) by suggesting that it is quite possibly that my .gitignore file is blocking anything to do with cache...

So I checked the .gitignore file and there is no reference to any cache files.

I'm using Tower & Beanstalk to run git and deploy. Is there anything default in these two that is causing a file not to upload.

Is there anyway of knowing which file it needs, so I can just manually upload it?

I'm running EE 2.8.1 and I did notice they added something to do with cache in this version. So maybe thats it. Is there anyway of disabling this?

http://ellislab.com/expressionengine/user-guide/optimization/caching.html#caching-drivers

EDIT: I changed the cache from file to dummy. I also reuploaded ALL the files via FTP without any Gitignore files interfering with the transfer. I still get this error. Is it something on the server I could change?

Thanks!

  • 1
    so it is works locally, but not prod? What php version you have on server? – Max Lazar Jun 10 '14 at 11:41
  • @MaxLazar I am running PHP Version 5.3.5, plenty enough for 2.8 Turns out it was because the folder inside "system/codeigniter/system/libraries/" was called "cache" not "Cache"! – Jason Mayo Jun 10 '14 at 19:11
3

/system/codeigniter/system/libraries/Cache/Cache.php Has the Cache class - Check this file is on the staging server, also check the permissions.

I've often had similar issues where it's related to case sensitivity and differing servers (my local not being case sensitive, the public servers are) - so also check that the folder and file are in the correct Case.

One key difference with the Cache class compared to any other class is that it's in a sub folder with the name "Cache" (note capital) - but a file search shows all references using the correct case :(

No - there's no way to disable it as it's a core class and will still be referenced.

| improve this answer | |
  • I thought it was something to do with case because I saw this post... devot-ee.com/add-ons/support/zoo-flexible-admin/viewthread/… which was a similar issue. Because the "class" in the error was lowercase I did try editing the files to be lower case. Turned out, all I needed to do was change the folder "cache" to "Cache" inside system/codeigniter/system/libraries/ Nightmare! Thanks! – Jason Mayo Jun 10 '14 at 19:09
  • Thanks Peter! There is 2 hours of my life I'd like back... :) – Jules Matthews Oct 20 '15 at 0:48
2

For me it was my .gitignore file was set to ignore all 'cache/' folders which must be case sensitive.

Changing to explicit paths fixed the issue once I redeployed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.