0
votes

For some reason, APC is caching files fine automatically but refuses to cache user variables when apc_add or apc_store are used.

I've posted a screenshot of APC and of the phpinfo() related. I recently changed the PHP session.save_path; could that have something to do with it? The new cache directory is holding files fine.

enter image description here

enter image description here

1
Do you get any errors anywhere? (Like when calling apc_store). - Halcyon
Have a look in your PHP error log - see if there's any notices there. Also, make sure errors are turned on in php.ini - ajtrichards
Frits: no errors are thrown. Alex: phpinfo() shows display_errors as ON. - user1111380

1 Answers

0
votes

D'oh.. problem was related to faulty caching code as a result of a cURL request. Sorry! Here is a code test to use for somebody else in the future:

$key = '1122334455';

if (apc_exists($key)) {
    echo "Key exists: "; 
    echo apc_fetch($key);
    }
    else {
    echo "Key NON-existent.";
    echo apc_add($key, true, 2700);
}