This is the same issue as #1194808: drush cc - does not clear cache.

[waverate@server-2 ~]$ drush cc all
WD php: Warning: apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

WD php: Warning: apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

WD php: Warning: apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

WD php: Warning: apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

'all' cache was cleared

apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

apc_cache_info(): No APC info available.  Perhaps APC is not enabled? Check apc.enabled in your ini file in DrupalAPCCache->clear() (line 239 of /var/www/html/drupal-7.4/sites/all/modules/apc/drupal_apc_cache.inc).

apc.php looks like it is working and the Status Report is showing the correct version of APC.

What should I be looking for?

Comments

waverate’s picture

Also,

$ pecl list
Installed packages, channel pecl.php.net:
=========================================
Package  Version State
APC      3.1.9   stable
memcache 3.0.6   beta

setting.php

include_once('./includes/cache.inc');
include_once('./sites/all/modules/memcache/memcache.inc');
$conf['cache_default_class'] = 'MemCacheDrupal';

$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
waverate’s picture

Status: Active » Needs review

Simple fix. Required:

apc.enable_cli=1

in php.ini.

berkas1’s picture

#2 worked for me:)

regilero’s picture

#2 worked for me as well.

But I wonder if there's away to give a php.ini file containing php settings to drush, so that the apc_cli gets the same configuration settings as the one I've set in ma apache virtualHost for apache...

regilero’s picture

Well, in #4 I said it worked. In fact I was wrong. It seems to work, but it's NOT POSSIBLE to flush APC cache from the command line. I fixed my own problems, launching a drushrc.php configuration file with drush -c /path/to/drushrc, set all apc settings in this file to get the same exact configuration for APC in cli mode and in apache mod_php mode. But debuging the drupal_apc_cache.inc source, I can ensure a cache clear from drush won't clear the APC cache for Apache.

What you're flushing is the APC cache for drush envirronement (so anything cached in APC while you was running Drupal in command line).

Some infos about APC and command line here :
* http://stackoverflow.com/questions/911158/how-to-clear-apc-cache-entries
* http://stackoverflow.com/questions/439262/how-can-i-get-php-to-use-the-s...

R.Muilwijk’s picture

Status: Needs review » Closed (won't fix)

When running in CLI mode you do not have access to the shared memory of your webserver/fastcgi PHP instance. So it's not possible to clear it's cache unless you do it with your webserver/fastcgi instance.

This will not be fixed, I might add some documentation on this though.

R.Muilwijk’s picture

jcuzella’s picture

Just an idea...

It may be possible to work around this by creating a small temporary php script to clear the APC cache in the webserver root, and then hitting the page with drush. Perhaps the best solution would be to have some sort of REST-API call out to Drupal.

Also, I seem to be getting some PHP errors when running drush commands after setting 'apc.enable_cli=1':

$ drush -y core-cron
[Mon Mar 12 17:52:24 2012] [apc-warning] Potential cache slam averted for key 'default|cache|context' in /var/www/htdocs/sites/all/modules/apc/drupal_apc_cache.inc on line 175.
[Mon Mar 12 17:52:28 2012] [apc-warning] Potential cache slam averted for key 'default|cache|apps_servers' in /var/www/htdocs/sites/all/modules/apc/drupal_apc_cache.inc on line 175.
[Mon Mar 12 17:52:28 2012] [apc-warning] Potential cache slam averted for key 'default|cache|apps_servers' in /var/www/htdocs/sites/all/modules/apc/drupal_apc_cache.inc on line 175.
[Mon Mar 12 17:52:28 2012] [apc-warning] Potential cache slam averted for key 'default|cache|apps_servers' in /var/www/htdocs/sites/all/modules/apc/drupal_apc_cache.inc on line 175.
Cron run successfully.                                                 [success]

Added 'apc.slam_defense = 0' and 'apc.write_lock = 1' to try and get rid of these but they still appeared.
This happens on:
* APC 3.1.3p1
* PHP 5.3.2-1ubuntu4.14
* Ubuntu 10.04.4 LTS (lucid)

jaypan’s picture

#2 got rid of the errors for me. I have no idea if it fixed anything, as I don't even know what was wrong! But I'm happy just to have the errors gone.