APC not speeding up PHP 5.4
===

I [have had this problem before on WAMP Server and PHP 5.3][1], and now facing it on Linux with PHP 5.4.

Basically, APC enabled or disabled makes no difference in performance, despite what the stats in apc.php say.

Here is a sample test script, which includes more than 30 Doctrine PHP files, and times it:

<!-- language: lang-php -->

    $t = microtime(true);
    include 'Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php';
    printf('%.3f s', microtime(true)-$t);

- Result on Windows (*Zend Server CE, PHP 5.4*) : `0.001 s`
- Result on Linux (*PHP 5.4 & APC 3.1.11*) : `0.106 s`

**Note: even if not displayed in the above script, I'm actually using a full path to the file, and not relying on the include_path.**

The result I get on Linux is the same whether `apc.enabled` is `0` or `1`, so it looks like the opcode caching is just not working.

However, `apc.php` says:

![apc.php][2]

Packages (from the [remi repository][3], CentOS 6.3):

    php-5.4.5-1.el6.remi.x86_64
    php-pecl-apc-3.1.11-1.el6.remi.1.x86_64

APC configuration:

    apc.enabled=1 
    apc.shm_segments=1
    apc.shm_size=64M
    apc.num_files_hint=1024
    apc.user_entries_hint=4096
    apc.ttl=7200
    apc.use_request_time=1
    apc.user_ttl=7200
    apc.gc_ttl=3600
    apc.cache_by_default=1
    apc.file_update_protection=2
    apc.enable_cli=1
    apc.max_file_size=1M
    apc.stat=1
    apc.stat_ctime=0
    apc.canonicalize=0
    apc.write_lock=1

Last thing, *yes*, PHP does report APC as enabled:

<!-- language: lang-php -->

    var_export(extension_loaded('apc'));
    true

Any hint?

  [1]: http://stackoverflow.com/q/6574999/759866
  [2]: http://i.stack.imgur.com/PiGGX.png
  [3]: http://rpms.famillecollet.com/