Skip to content

Await php.ini writes during boot - #4265

Draft
mho22 wants to merge 1 commit into
trunkfrom
await-php-ini-writes
Draft

Await php.ini writes during boot#4265
mho22 wants to merge 1 commit into
trunkfrom
await-php-ini-writes

Conversation

@mho22

@mho22 mho22 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

bootRequestHandler() called setPhpIniEntries() without awaiting it. That function awaits php.readFileAsText() before writing, so it returns at the await point and the write to php.ini lands in a later microtask.

applyLegacyPhpIniOverrides() ran next and merged the legacy network-disable list into the same file. On legacy PHP it could read php.ini before the phpIniEntries write had landed, and the late write then overwrote disable_functions, allow_url_fopen, and date.timezone. applyLegacyPhpIniOverrides() had the same defect internally: it called setPhpIniEntries() without awaiting and returned void.

What this changes

createPhp() in boot.ts awaits both setPhpIniEntries() and applyLegacyPhpIniOverrides(). applyLegacyPhpIniOverrides() becomes async, returns Promise<void>, and awaits its own write.

This is not a breaking change. applyLegacyPhpIniOverrides() is not re-exported from @wp-playground/wordpress and bootRequestHandler() is its only caller.

Testing

  • npx nx test playground-wordpress — 136 passed.
  • npx nx run playground-cli:test-playground-cli --testFiles=run-cli.spec.ts — 97 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant