"opcache.memory_consumption cannot be changed when OPcache is already set up" warning on 8.5 ZTS
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the OPcache INI handling around the accel_startup_ok condition and compare the startup stage used by ZTS worker threads. Reproduce the warning with the provided FrankenPHP Docker command, then verify that the warning is suppressed and opcache_get_configuration reports the configured value without changing the actual shared-memory size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100