php / php/php-src

FPM is maliciously compliant when asked to set opcache.preload

Open
#9,722 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Extension: opcache SAPI: fpm Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following FPM configuration:

php_value[opcache.preload] = /app/config/preload.php
php_value[opcache.preload_user] = app

results in phpinfo() advertising that config.

Yet when calling opcache_get_status(), there is no preload_statistics, and there is no performance improvement in the application.

I asked about this here, and was told that's because it is too late: when setting that config value, FPM has already started. If that's the case, I would expect an exception to be thrown, because I can think of a reason to allow editing that setting past a certain point

PHP Version

8.1.7

Operating System

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the FPM configuration with php_value[opcache.preload] and php_value[opcache.preload_user], then compare phpinfo() with opcache_get_status(). Trace when FPM applies these settings relative to opcache preload initialization; done should define and test the behavior when a preload setting is applied too late.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.