php / php/php-src

"opcache.memory_consumption cannot be changed when OPcache is already set up" warning on 8.5 ZTS

未关闭
#22,216 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Extension: opcache Status: Verified
主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

accel_startup_ok 条件附近的 OPcache INI 处理开始,并比较 ZTS 工作线程使用的启动阶段。使用提供的 FrankenPHP Docker 命令复现警告,然后验证警告已被抑制,并且 opcache_get_configuration 报告配置的值,同时不更改实际的共享内存大小。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。