Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring Memcache + CakePHP, "Cache not configured properly" error
    primarykey
    data
    text
    <p>I'm setting up cacheing for a CakePHP application and having a really hard time getting it to talk to Memcache.</p> <p>I've written the caching code while testing against the File based caching engine, and all the logic is solid. When I watch debug traffic, caches hit, miss, and expire properly. I wanted to switch over to Memcache because the Filesytem based cache doesn't really offer any performance improvement, but I can't seem to get it to work at all.</p> <p>As soon as I change the Caching engine in Cache::config to Memcache, I get the following error:</p> <pre><code>Warning (512): Cache not configured properly. Please check Cache::config(); in APP/config/core.php [CORE/cake/libs/configure.php, line 663] </code></pre> <p>This happens with a simple configuration call, like:</p> <pre><code>Cache::config('default', array( 'engine' =&gt; 'Memcache' )); </code></pre> <p>Or a more complicated one, like the default one suggested in core.php:</p> <pre><code>Cache::config('default', array( 'engine' =&gt; 'Memcache', //[required] 'duration'=&gt; 3600, //[optional] 'probability'=&gt; 100, //[optional] 'prefix' =&gt; Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string 'servers' =&gt; array( '127.0.0.1:11211' // localhost, default port 11211 ), //[optional] 'compress' =&gt; false, // [optional] compress data in Memcache (slower, but uses less memory) )); </code></pre> <p>Cache.check is set to true, eg <code>Configure::write('Cache.check', true);</code> and Cache.disable is not set. Again, all the caching logic works great as long as I'm using <code>'engine' =&gt; 'File'</code>. </p> <p>I get the same error whether memcached is running or not. This error seems to encompass a ton of different problems - extensive searching has revealed a huge variety of potential solutions to problems with this error message. I've double checked that my tmp directories exist (per <a href="http://ryan.ifupdown.com/2009/08/05/warning-512-cache-not-configured-properly-please-check-cacheconfig-in-appconfigcore-php-corecakelibsconfigure-php-line-663/" rel="nofollow noreferrer">http://ryan.ifupdown.com/2009/08/05/warning-512-cache-not-configured-properly-please-check-cacheconfig-in-appconfigcore-php-corecakelibsconfigure-php-line-663/</a>), I'm running on Ubuntu, so there are no pathing issues (which have been a problem in the past, per <a href="https://trac.cakephp.org/ticket/4433" rel="nofollow noreferrer">https://trac.cakephp.org/ticket/4433</a> and <a href="http://cakephp.1045679.n5.nabble.com/cake-1-2-problem-with-cache-td1302563.html" rel="nofollow noreferrer">http://cakephp.1045679.n5.nabble.com/cake-1-2-problem-with-cache-td1302563.html</a>). I am running a relatively old version of Cake (1.2.5), but I tried upgrading and had the same error message (along with a million other upgrade-related errors that I don't really have time to hunt down.)</p> <p>Is there any way to get more detailed information out of Cake about what's actually going wrong? I get the feeling that this error is just a catch-all error for anything that goes wrong in the cache class initialization, and there are tons of potential problems. Changing the debug level up to 3 doesn't reveal anything more. If I could get more info I might be able to do something, but I'm totally flying blind. I'm a mostly-novice Cake user, so any general guidance about best practices for dealing with bizarre Cake bugs would be much appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload