php / php/php-src

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

Aperta
#22,216 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug Extension: opcache Status: Verified
Lingua principale
C
Stelle
40.4k
Fork
8.1k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dalla gestione INI di OPcache intorno alla condizione accel_startup_ok e confronta la fase di avvio utilizzata dai thread worker ZTS. Riproduci l'avviso con il comando Docker di FrankenPHP fornito, quindi verifica che l'avviso venga soppresso e che opcache_get_configuration riporti il valore configurato senza modificare la dimensione effettiva della memoria condivisa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, php
Ambito
backend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.