Hi,
I was looking forward to using this module,
Got this error? When I went to Drupal Performance and hit the clear all caches button
Fatal error: Class 'APCIterator' not found in /var/www/thesitenamehere/web/sites/all/modules/apc/drupal_apc_cache.inc on line 243
Sorry, I am not that advanced at server stuff and someone else has installed APC on the server.
As for the module followed the instructions including:
Did standard set up, by putting
/**
* Add APC Caching.
*/
$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';
//$conf['apc_show_debug'] = TRUE; // Remove the slashes to use debug mode.
in the settings.php file
Then changed
variable_get('cache_default_class', 'DrupalDatabaseCache')
to
variable_get('cache_default_class', 'DrupalAPCCache')
in includes/cache.inc
I did all this obviously after I had installed and enabled the APC module in the Drupal modules manager.
Have since taken the code out of the settings.php file and set the cache.inc file back to variable_get('cache_default_class', 'DrupalDatabaseCache') and disabled the module. Without issue. But still interested in using this module. Because of the obvious performance benefits.
Thanks and all the best from Josh
Comment | File | Size | Author |
---|---|---|---|
#10 | 1587110_apc_cache_backends.patch | 921 bytes | MrHaroldA |
Comments
Comment #1
seaarg CreditAttribution: seaarg commentedI can confirm this bug, It happened to me following instructions from readme.txt
Comment #2
hansrossel CreditAttribution: hansrossel commentedYou need at least APC version 3.1.1, because this class was then introduced: http://pecl.php.net/package-changelog.php?package=APC.
Comment #3
hansrossel CreditAttribution: hansrossel commentedI think this is rather a documentation issue, just need to specify in the readme.txt that the APC version needs to be higher than 3.1.1.
Comment #4
jlhs CreditAttribution: jlhs commentedThankyou hansrossel
Unfortunately we have APC version 3.1.3p1-2 installed and still we got that error.
All the best
Comment #5
seaarg CreditAttribution: seaarg commentedhansrossel, thanks for the info, I have APC v 3.0.19 installed, will try to upgrade.
Comment #6
hansrossel CreditAttribution: hansrossel commentedjlhs, not sure what your issue is then maybe some setting in php.ini, or maybe you still need a higher version of APC anyway. I had the error on APC 3.0.9 and upgraded to the latest stable version which is 3.1.9. and this solved this issue.
Comment #7
jlhs CreditAttribution: jlhs commentedThankyou for the advice hansrossel,
I will ask the server admin, to install the latest stable version of APC
Comment #8
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedReporting the same problem with APC 3.1.9 installed from apt on Ubuntu 12.04 LTS. There must be a php.ini issue here.
Comment #9
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedahhh - this is a simple problem. Lots of caching modules (including APC) tell you to add their system to settings.php with a line like this:
But then they overwrite each other. I had Varnish configuration later on in settings.php, which was using the same structure. Better is:
This should probably be updated in the documentation...
Comment #10
MrHaroldA CreditAttribution: MrHaroldA commentedHere's a patch with the suggested documentation change by ohthehugemanatee.
The suggested core-hack is somewhat ugly too:
Comment #11
-Mania- CreditAttribution: -Mania- commentedGetting the error even with #9. :/
Comment #12
-Mania- CreditAttribution: -Mania- commentedSorry, I was mistaken, the problem was with the old APC version as previously been noted also.
Comment #13
R.Muilwijk CreditAttribution: R.Muilwijk commentedThough your problem was fixed with the the APC version the patch in #10 is still valuable and committed.
Comment #15
dahousecat CreditAttribution: dahousecat commentedI am still getting this error.
It only occurs when I run the cron via the drush command.
Exact error I'm getting is:
PHP Fatal error: Class 'APCIterator' not found in /var/www/sites/all/modules/thirdparty/apc/drupal_apc_cache.inc on line 245
Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'APCIterator' not found in /var/www/sites/all/modules/thirdparty/apc/drupal_apc_cache.inc, line 245
I am using APC 3.1.13.
Any suggestions?
Comment #16
jvsteiner CreditAttribution: jvsteiner commentedIm also using APC 3.1.13. I had this same problem as well. I was able to get the error to stop occurring by putting "apc.enable_cli = 1" in my apc.ini file. I tried this because I read elsewhere that cli needs to be enabled explicitly. It seems to have worked to some degree, since drush no longer terminated abnormally, however, it revealed another problem (warning) on the very next line: Invalid argument supplied for foreach() drupal_apc_cache.inc:246
the relevant portion of drupal_apc_cache.inc contains a bug:
$ator should be $iterator. changing it worked for me.