1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/sapi/fpm/tests
Tim Düsterhus 2a086e4e73 opcache: Improve error messages when “temporarily enabling OPcache” (#19619)
* opcache: Do not emit “temporary enabling” message when OPcache is already active

An easy way to accidentally enable OPcache “temporarily” is by using
`php_admin_value[opcache.enable]=1` within a FPM pool’s configuration, since
the `php_admin_value` settings mostly behave like settings in php.ini, with
many OPcache INI settings being a notable exception.

As long as OPcache is already enabled within php.ini (or simply by default),
emitting a warning for `php_admin_value[opcache.enable]=1` or similar is going
to be confusing, since is not actually temporarily enabling anything.

A follow-up commit will also try to detect this kind of incorrect configuration
and try to provide better advice for cases where OPcache is actually not yet
enabled.

* opcache: Improve error message when OPcache is enabled dynamically

The error message will now advice on the `php_admin_value[opcache.enable]=1`
mistake. It will also send the message to OPcache’s logging facility instead of
the regular error handling logic during startup so that it will not be made
available to `error_get_last()`, since it is related to a specific request and
thus not actionable by a script either.

php/php-src#19146 made a related change to `opcache.memory_consumption`.

* opcache: Fix typo in warning message

* opcache: Use more formal language in warning message
2025-08-31 00:32:42 +02:00
..
2018-06-12 17:59:28 +01:00
2018-06-12 17:59:28 +01:00
2020-02-03 09:57:34 +01:00
2020-02-03 22:52:20 +01:00
2018-06-12 17:59:28 +01:00
2018-06-12 17:59:28 +01:00
2018-06-12 17:59:28 +01:00
2018-06-12 17:59:28 +01:00
2018-06-12 17:59:28 +01:00