How to set up CApcCache

I want to use APC cache in function. After setting up the config


   'cache' => array(

    'class' => 'system.caching.CApcCache',

),

but it does not work. What ever I set up to cache, it always returns false.


$result = '121';

$cache_key = 'key_12';

Yii::app()->cache->set($cache_key,$result,300);

echo Yii::app()->cache->get($cache_key);// always return false

You need to install the APC extension for PHP.

if you use linux


$ sudo apt-get install php-apc

No. That’s if you’re using Debian, Ubuntu or an offspring of that ::)

We use, PHP_CGI and configuration does not support the PHP APC…

:o :mellow:

Recently read about some serious security issues related to php-cgi. See: http://www.php-security.net/archives/9-New-PHP-CGI-exploit-CVE-2012-1823.html