0
votes

I have PHP 5.5 and opcache enabled

My phpInfo shows this : http://gyazo.com/97afb5a768f95e1ff2d35bb239a62afa

opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.max_file_size=15M
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.revalidate_freq=60
opcache.save_comments=0
opcache.load_comments=0
opcache.fast_shutdown=1
opcache.enable_file_override=1

But If I put it On or Off and restart apache I still don't see any difference in page loads...

••• I see "caches misses" ; what does this means ? And cache hits 0

I also installed different opcache gui panels and I see only 1 cached file.

••• I'm I missing something ?

Do I need to place a php opcache function in my php files ???

Thanks to help me.

2
var_dump(opcache_get_status()); post the results ofthat - user557846
var_dump(opcache_get_status()); shows [num_cached_scripts] => 85 [hits] => 0 [misses] => 85 .... What does hits and misses refers to ? - user2986055
hit=cached file used, miss=original file served - user557846
can you post your full phpinfo , some types of php instances do not support opcache - user557846

2 Answers

0
votes

Opcache uses an SMA as its in-memory cache. This only persists whist the process (or process tree) exists. I suspect that you are using a CLI variant of PHP where the process only exists for one request. With the Apache and FastCGI variants, the cache does persist across multiple requests.

0
votes

I finally know what was the problem in my case...

My server was in suPHP and opcache was not really working even if php.ini says yes...

I switched to FastCGI and booom !!! opcache DOES make a difference...