Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9018963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:39:47+00:00 2026-06-16T04:39:47+00:00

Firstly both Memcache and APC are installed successfully using PECL (and are verified as

  • 0

Firstly both Memcache and APC are installed successfully using PECL (and are verified as working) on my Macbook Pro dev server running PHP 5.3.15

I’ve just baked a test Cake 2.2.2 app. In Config/core.php I have the following:

/**
 * Pick the caching engine to use.  If APC is enabled use it.
 * If running via cli - apc is disabled by default. ensure it's available and enabled in this case
 *
 */
$engine = 'File';
if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) {
    $engine = 'Apc';
}
if (extension_loaded('memcache') && php_sapi_name() !== 'cli') {
    $engine = 'Memcache';
}

// In development mode, caches should expire quickly.
$duration = '+999 days';
if (Configure::read('debug') >= 1) {
    $duration = '+10 seconds';
}

// Prefix each application on the same server with a different string, to avoid Memcache and APC conflicts.
$prefix = 'mcmyapp_';

/**
 * Configure the cache used for general framework caching.  Path information,
 * object listings, and translation cache files are stored with this configuration.
 */
Cache::config('_cake_core_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_core_',
    'path' => CACHE . 'persistent' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration
));

/**
 * Configure the cache for model and datasource caches.  This cache configuration
 * is used to store schema descriptions, and table listings in connections.
 */
Cache::config('_cake_model_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_model_',
    'path' => CACHE . 'models' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration
));


Cache::config('default', array(
    'engine' => $engine,
    'serialize' => ($engine === 'File'),
    'duration'=>$duration,
    'prefix'=>$prefix,
));

debug(Cache::settings());

The output of the above final debug() is:

array(
    'prefix' => '*****',
    'engine' => 'Memcache',
    'serialize' => false,
    'duration' => (int) 10,
    'servers' => array(
        (int) 0 => '127.0.0.1'
    ),
    'compress' => false,
    'persistent' => true,
    'probability' => (int) 100,
    'groups' => array()
)

So in core.php it appears that Cake wants to use Memcache for its caching engine.

However, when I visit localhost/myapp/pages/home in my browser, CakePHP’s default, freshly-baked welcome page greets me, informing me that The FileEngine is being used for core caching

Anywhere else in my app (other than in core.php) if I debug(Cache::settings()), I get the following:

array(
    'prefix' => '*****',
    'engine' => 'File',
    'serialize' => false,
    'duration' => (int) 10,
    'servers' => array(
        (int) 0 => '127.0.0.1'
    ),
    'compress' => false,
    'persistent' => true,
    'probability' => (int) 100,
    'groups' => array()
)

Basically, CakePHP appears to revert to File for caching, ignoring my configuration in core.php to use Memcache… unless I’ve done something wrong here??!

I’ve tried this with Configure::write('debug', 0) and Configure::write('debug', 1).

I should mention that with the above, both APC and Memcache extensions are enabled in php.ini.

Any help would be gratefully received, thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:39:48+00:00Added an answer on June 16, 2026 at 4:39 am

    Memcached should be on some port, default one is 11211 (check)… So your config tries to connect to Memcached, fails and reverts back to default (File) cache…

    Try:

    Cache::config('default', array(
        'engine' => 'Memcache',
        'duration'=> 3600, 
        'probability'=> 100, 
        'servers' => array('127.0.0.1:11211') <<<<==
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given that both the client and the server need to know everything about the
Its prudent that I firstly say I'm new to both Rhino Mocks and to
Firstly, what is the best/simplest way to detect if X11 is running and available
Firstly, I am new to both android and Java. I have two classes, my
Firstly, I studied apple's sample codes : SeismicXML and TopSongs but both of them
We have just installed/configured a new web server to replace our out-of-date one. Let's
I am currently working with COM objects in managed code and am using the
Firstly, I am using the latest version of Oracle ApEx 4.1.1 and have the
Firstly to show you what I am trying to achieve in the view, a
Firstly, I wrote my customized setter for an NSString* like this: - (void)setDateString:(NSString *)newDateString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.