Search code examples
phpapcpecl

What version of apc (or php) is the APCIterator class available?


I'm trying to use the APCIterator class, and on a number of system configurations I'm getting a Fatal Error: class 'APCIterator' not found error.

I've tried:

  • Fedora 11, PHP 5.2.13, APC 3.0.19
  • Centos 5, PHP 5.2.14, APC 3.1.4
  • Windows 7, PHP 5.2.7, APC 3.0.19

APC is installed correctly and working fine using the apc_store() and apc_fetch() methods, just the APCIterator class is causing problems.

There's very little documentation on when the class was introduced, and which version of APC/PHP it comes with. The best I can find is a comment in the changelog on the PECL site suggesting APCIterator was introduced in APC 3.1.1

Can anyone tell me if there's something I need to install, or a version I need to upgrade to to use this?


Solution

  • I was getting the same error on APC 3.1.9 and 3.1.7.

    It turns out it only works if you put apc.enable_cli=1 in your php.ini!