The class ‘APCIterator’ could not be found

This one catches me out every time, so documenting here for posterity.

Firstly, make sure apc or apcu (PHP 5.5+) is installed by running php -m | grep apc.

If you do have it installed but you’re still getting the error The class 'APCIterator' could not be found. then you probably need to enable APC on the command line. Make sure the following lines exist in your php.ini file:

apc.enabled = on
apc.enable_cli = on

Michael is a polyglot software engineer, committed to reducing complexity in systems and making them more predictable. Working with a variety of languages and tools, he shares his technical expertise to audiences all around the world at user groups and conferences. You can follow @mheap on Twitter

Thoughts on this post

Leave a comment?

Leave a Reply