[php-src] Issue #7915: php_opcache crash - memory access violation
| From: | cmb69 | Date: | Sat, 08 Jan 2022 22:38:46 +0000 |
| Subject: | [php-src] Issue #7915: php_opcache crash - memory access violation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238895@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7915
Comment Author: cmb69
Yes, you need to set
opcache.file_cache explicitly, but I don't think this will
help in your case. If attaching to the shared memory fails, and there is no file_cache, the script
is run without OPcache. Whether file_cache brings a considerable performance improvement, on Windows
at least, depends on the script. When I checked several Web apps a while ago, the performance
improvement with file_cache_only was disappointing (perhaps due to the generally slow file access on
Windows).
And no, you can't set opcache.cache_id during runtime (via
ini_set()), since it is PHP_INI_SYSTEM and needs to be this way, since
attaching to OPcache shared memory happens before any scripts are run. It is generally possible to
read the value from an environment variable, or to set INI settings via the registry (for certain
folders). That might be a viable option for you.
Any other OPcache setting is not affected by opcache.cache_id. Regarding
opcache.memory_consumption=512; that sounds like a pretty large value; maybe you can
get away with far less, especially when you have individual caches? Maybe you can add some logging
to the scripts which shows the actual consumption (via opcache_get_status()).