I am using php-fpm 7.4.3 on ubuntu 20.04. My blacklist of opcache doesn't work at all. Scripts I visited are cached when file_cache is enabled. Here's my configures.
php.ini
opcache.save_comments=0
opcache.blacklist_filename="/etc/php/opcache_blacklist.txt"
opcache.file_cache="/tmp/php"
opcache.file_cache_fallback=0
opcache_blacklist.txt
/*
/**
/**.php
/*.php
*.php
**
**.php
test.php
<pre>
<?php
print_r(opcache_get_status(true));
?>
</pre>
Some information from test.php
[used_memory] => 9821016
[num_cached_scripts] => 44
[num_cached_keys] => 45
[max_cached_keys] => 16229
[blacklist_misses] => 2
[scripts] => Array
(
....
)
There is a strange thing: everytime I refresh the test.php, blacklist_misses
is increased by 1.
If I disable file_cache (opcache.file_cache=
) in php.ini, num_cached_scripts
and num_cached_keys
become 0, blacklist_misses
keeps increasing, blacklist_miss_ratio
is always 100.
PHP documentation doesn't tell me that file_cache will affect blacklist, is this by design or a bug?