Skip to content

Give the Docker workers the PHP settings of the host as their php.ini - #423

Merged
schlessera merged 1 commit into
mainfrom
fix/docker-host-ini-as-php-ini
Nov 2, 2026
Merged

schlessera merged 1 commit into
mainfrom
fix/docker-host-ini-as-php-ini

Conversation

@schlessera

@schlessera schlessera commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

The Docker workers get the host's settings for error reporting, memory_limit and so on from a file mounted into conf.d. PHP loads conf.d even for a process started with php -c <file>, but on the host such a file replaces the php.ini and the settings in it. So in the containers a scenario's own configuration file was overridden.

This broke Custom ini configuration in server-command (wp server --config=custom.ini with memory_limit = 512M): on the GitHub runners the host has memory_limit = -1, which won. server-command's main has been red since Docker workers were switched on (e.g. https://github.com/wp-cli/server-command/actions/runs/41472580912).

The file is now mounted as the container's php.ini. The official PHP images don't ship one, so nothing else gets replaced. Checked in php:8.3-cli with the host file holding memory_limit = -1:

mounted as php -r php -c custom.ini -r
conf.d/zz-wp-cli-tests-host.ini (before) -1 -1
php.ini (now) -1 512M

composer phpcs, phpstan and phpunit --filter TestBehatParallel pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated how the generated PHP settings file is loaded. Settings now apply through the container’s primary PHP configuration, while processes started with their own configuration remain unaffected.

As a file in conf.d, the settings were also loaded by processes that pass
a configuration file of their own, which on the host replaces them. With
memory_limit = -1 on the GitHub runners, the custom ini scenario of
server-command (wp server --config) got -1 instead of its own 512M.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera
schlessera requested a review from a team as a code owner November 2, 2026 16:09
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 369c58ba-8ade-43e2-b191-c1bbbb9167e1
Commits

Reviewing files that changed from the base of the PR and between 5975d9b and d2fcb3a.

Files selected for processing: 1
  • utils/behat-parallel.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The generated PHP settings file is now mounted at /usr/local/etc/php/php.ini instead of in conf.d. Comments state that it replaces the container's php.ini and does not apply to processes started with their own configuration file.

Changes: PHP configuration mount

Layer / File(s) Summary
Primary PHP configuration mount
utils/behat-parallel.php
The settings file mount targets /usr/local/etc/php/php.ini. Comments describe the replacement and clarify that processes started with their own configuration file do not receive these settings.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested labels: bug, scope:testing, scope:distribution

Suggested reviewers: brianhenryie

Merge Risk: Minimal · up to d2fcb

No actionable merge-blocking risk remains; the configuration precedence change is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: providing host PHP settings to Docker workers through the container's php.ini.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added automated-pr bug Something isn't working scope:testing Related to testing labels Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@schlessera
schlessera merged commit 169fafa into main Nov 2, 2026
75 checks passed
@schlessera
schlessera deleted the fix/docker-host-ini-as-php-ini branch November 2, 2026 16:22
@schlessera schlessera added this to the 5.5.2 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-pr bug Something isn't working scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant