when checking realpath_cache_get() we see foo.php is added to the realpath cache
as soon as opcache has cached this require once foo.php, foo.php is removed from realpath cache - for most worker processes.
Questions:
1) opcache seems to be able to clear the realpath cache for some (?) workers - how is opcache able to do that? or does this happen on every request separately? (how come that foo.php is still in realpath cache for some workers though?)
2) no matter what (is_file, realpath,...) calls with ../foo.php will never make it populate realpath cache again with this file, once it's in opcache - even when calling clearstatcache before it because the file is potentially deleted beforehand. It always seems to fetch the full path again from disk instead of storing it in realpath?
Description
realpath cache is a per process cache opcache is a shared cache
opcache is enabled with validation 2 seconds
foo.php contains:
bar.php contains:
with php-fpm request bar.php multiple times.
when checking realpath_cache_get() we see foo.php is added to the realpath cache as soon as opcache has cached this require once foo.php, foo.php is removed from realpath cache - for most worker processes.
Questions: 1) opcache seems to be able to clear the realpath cache for some (?) workers - how is opcache able to do that? or does this happen on every request separately? (how come that foo.php is still in realpath cache for some workers though?)
2) no matter what (
is_file
,realpath
,...) calls with../foo.php
will never make it populate realpath cache again with this file, once it's in opcache - even when calling clearstatcache before it because the file is potentially deleted beforehand. It always seems to fetch the full path again from disk instead of storing it in realpath?PHP Version
8.3
Operating System
No response