diff --git a/NEWS b/NEWS index ae8cf7dbb874..07678f94647a 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,11 @@ PHP NEWS Phar::addEmptyDir() for paths starting with "/.phar", while allowing non-magic directory names that merely share the ".phar" prefix. (Weilin Du) +- Opcache: + . Fixed bug GH-22216 (spurious opcache.memory_consumption warning on each new + ZTS thread; the directive is also reported as 0 in worker threads). + (Daisuke Komazaki) + - Zlib: . Fixed memory leak if deflate initialization fails and there is a dict. (ndossche) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 6f668af9b714..882c78fd1f2a 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -79,7 +79,9 @@ static int validate_api_restriction(void) static ZEND_INI_MH(OnUpdateMemoryConsumption) { - if (accel_startup_ok) { + /* On ZTS, each new thread runs the on_modify handlers at STAGE_STARTUP to + * populate its own globals; that is thread init, not a post-startup change. */ + if (accel_startup_ok && stage != ZEND_INI_STAGE_STARTUP) { if (strcmp(sapi_module.name, "fpm-fcgi") == 0) { zend_accel_error(ACCEL_LOG_WARNING, "opcache.memory_consumption cannot be changed when OPcache is already set up. Are you using php_admin_value[opcache.memory_consumption] in an individual pool's configuration?\n"); } else {