Symptoms:
- You have the Apc cache engine turned on it Config/bootstrap.php and Config/core.php
- You are running php-fpm
- You run the cake console from the command line inside your app dir and you get the below error
// Config/bootstrap.php // Setup a 'default' cache configuration for use in the application. Cache::config('default', array('engine' => 'Apc'));
//Config/core.php $engine = 'Apc';
Warning Error when Apc Cache is turned on and you run cake console
Warning Error: _cake_core_ cache was unable to write 'file_map' to Apc cache in [/home/user/cakephp-2.5.4/lib/Cake/Cache/Cache.php, line 323] 2014-09-25 15:46:22 Warning: _cake_core_ cache was unable to write 'file_map' to Apc cache in [/home/user/cakephp-2.5.4/lib/Cake/Cache/Cache.php, line 323] Warning Error: _cake_core_ cache was unable to write 'object_map' to Apc cache in [/home/user/cakephp-2.5.4/lib/Cake/Cache/Cache.php, line 323] 2014-09-25 15:46:22 Warning: _cake_core_ cache was unable to write 'object_map' to Apc cache in [/home/user/cakephp-2.5.4/lib/Cake/Cache/Cache.php, line 323]
Resolution
Go into your php.ini apcu.ini settings and enable apcu for the php cli
On fedora 20 the configuraton settings for apcu are in /etc/php.d/apcu.ini
; Setting this enables APCu for the CLI version of PHP ; (Mostly for testing and debugging). apc.enable_cli=1
Thanks - This helped me out. Works with Ubuntu 14.04 too except the apcu.ini is in /etc/php5/cli/conf.d/.