What could cause Craft to not define the request object?

I have a local site that recently stopped loading (front-end and back-end)

The error is happening in WebApp.php (line 630) when $this->request->getBrowserLanguages() method runs. The script fails because $this->request is not defined.

Other Craft installations work just fine. This site works just fine on a dev and live server with the same code. Any ideas on what I bumped?

  • Can you share the full stack trace leading up to the error? – Brad Bell Aug 21 '14 at 22:13
  • Just sent you an email with it (didn't want to post the path info here) – Ben Parizek Aug 21 '14 at 23:06
  • It looks like this has been caused by a new line that was added in the general.php 'cacheMethod' => 'apc'. I'm guessing I don't have this installed locally. Still looking into this and will update when confirmed. – Ben Parizek Aug 22 '14 at 0:24

This issue turned out to be caused by a config setting that had been added to general.php

'cacheMethod' => 'apc'

The server had APC installed but my local environment did not. There were a couple options to fix this:

  1. Install Alternative PHP Cache (APC)
  2. Setup a multi-environment config and override the cacheMethod setting with another method that is supported in your local environment, such as 'cacheMethod' => 'file'
  3. Remove this line as it may not be needed anyway. apc is PHP byte caching and if your running PHP 5.5, that's enabled by default and apc is unnecessary

I had the same issue. But I was using memcache.

It turns out it was acually memcached which is a slightly different extension.

Enable the setting in the memcache.php config file with

'useMemcached' => true,

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.