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 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Extension: opcache Status: Verified
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. 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 を短くまとめたダイジェスト。