You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's unclear what exactly the difference between opcache.revalidate_path and opcache.use_cwd is and it seems they're noop (in CLI?)?
Assuming php.ini has: include_path=/dev/null
According to php/php-src#17769 (comment) this shouldn't result in a fatal, because the provided path is the same for both, so it shouldn't even attempt to load the other
Also it's not entirely clear what the difference between these 2 directives actually is, based on a practical example.
PHP Version
PHP 8.4
Operating System
No response
The text was updated successfully, but these errors were encountered:
Opcache uses the the string that the user passed to require as a key in the script map. opcache.use_cwd incorporates the current working directory into this key. This is mostly needed for shared hosting, i.e. where different projects may use the same path name relative to the cwd, pointing to different files. It's also worth noting opcache.use_cwd has no effect for absolute files. This settings is enabled by default.
opcache.revalidate_path on the other hand actually opens the file to use the resolved path as a key. This indeed makes opcache.use_cwd redundant. However, it will be even slower, but also more accurate. It may make a difference for symlinks (avoiding duplicate compilation), or multiple include_paths where the files are created dynamically (e.g. script from 2nd path was compiled and cached, script is created in 1st path, repeated inclusion will stick with 2nd path).
Does this resolve your questions? I agree that this may be documented better. I'll move it to the documentation bug tracker.
Description
The following code:
It's unclear what exactly the difference between opcache.revalidate_path and opcache.use_cwd is and it seems they're noop (in CLI?)?
Assuming php.ini has:
include_path=/dev/null
/foo/safe.php
/bar/safe.php
/foo/x.php
/bar/y.php
/test.php
php -dopcache.enable_cli=1 -dopcache.revalidate_path=0 -dopcache.use_cwd=0 test.php
Resulted in this output:
But I expected this output instead:
Changing /foo/x.php or /bar/y.php to
has the same issue too.
According to php/php-src#17769 (comment) this shouldn't result in a fatal, because the provided path is the same for both, so it shouldn't even attempt to load the other
Also it's not entirely clear what the difference between these 2 directives actually is, based on a practical example.
PHP Version
PHP 8.4
Operating System
No response
The text was updated successfully, but these errors were encountered: