Search code examples
phpstorefetchapc

PHP APC Cache Doesn't works 100%


I found some problem. When i running apc_store and more times update a page (refresh). APC stores previous value and do not stores updated value.

It's following code:

<?php for($i=0;$i<5;$i++) { apc_store('test', $i); echo apc_fetch('test'); } ?>

True output is: 1,2,3,4,5

But sometimes i have: 5,5,5,5,5

Why and how i can correct that bug?

Apc version is last: 3.1.9


Solution

  • From the manual: apc_store

    Returns TRUE on success or FALSE on failure.

    Check it, it could be that it fails to store. Why would apc_store() return false?