I have a php script which clears apc. The script is working fine, when I opening it using browser, but when I am running that file from command line, it is not clearing cache.
I checked for apc.enable_cli setting, and that is also on (check the screenshot).
And here is my php-code
<?php
if (isset($argv[1])) {
$key = $argv[1];
$info = apc_cache_info("user");
foreach ($info['cache_list'] as $obj) {
if (strstr($obj['info'], $key)) {
apc_delete($obj['info']);
}
}
} else {
apc_clear_cache("user");
}
?>
What am I missing or doing wrong?