Who’s down with Apc? It almost wasn’t me

Written by James McDonald

September 25, 2014

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

 

1 Comment

  1. Joel

    Thanks – This helped me out. Works with Ubuntu 14.04 too except the apcu.ini is in /etc/php5/cli/conf.d/.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Toggen builds a new website

So I have built and hosted a new website for Roger Clark Pest Management they are a family owned and operated Pest...

WizTree

Just downloaded WizTree (not a sponsor) from https://wiztreefree.com/ It seems to do what it says on the tin which is...

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...