"opcache.memory_consumption cannot be changed when OPcache is already set up" warning on 8.5 ZTS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.2k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
Description
In PHP 8.5.6, when running a ZTS application with the following settings in the ini file,
opcache.memory_consumption cannot be changed when OPcache is already set up.
this warning is printed once for each thread that is started.
opcache.enable=1
opcache.memory_consumption=256
opcache.log_verbosity_level=2
I reproduced it with FrankenPHP's ZTS/worker mode, but I have confirmed that it reproduces even without FrankenPHP.
Here are the reproduction steps with FrankenPHP.
docker run -d --name fp-repro -v /tmp/fp-repro/zz-repro.ini:/usr/local/etc/php/conf.d/zz-repro.ini:ro dunglas/frankenphp:php8.5
It does not affect the actual SHM size, but it also appears that the value referenced by worker threads via opcache_get_configuration and similar functions is reported as 0.
The condition that triggers this warning is currently if (accel_startup_ok), but it looks like the condition stage != ZEND_INI_STAGE_STARTUP needs to be added.
PHP Version
PHP 8.5.6 (cli) (built: May 19 2026 23:07:51) (ZTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.6, Copyright (c) Zend Technologies
with Zend OPcache v8.5.6, Copyright (c), by Zend Technologies
Operating System
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en el manejo de INI de OPcache alrededor de la condición accel_startup_ok y compara la etapa de inicio utilizada por los hilos de trabajo de ZTS. Reproduce la advertencia con el comando de Docker de FrankenPHP proporcionado y, después, verifica que la advertencia se suprima y que opcache_get_configuration informe del valor configurado sin cambiar el tamaño real de la memoria compartida.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, php
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 58/100