Skip to content

Disable opcache if no SHM backend is available #19350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arnaud-lb
Copy link
Member

@arnaud-lb arnaud-lb commented Aug 2, 2025

Currently, ./configure fails when no SHM backend is available (we support a wide range of systems with mmap(MAP_ANONYMOUS), shmget(), shm_open(), but some non-standard systems may not have any of these). Additionally, even after bypassing the configure check, Opcache emits a fatal error if no SHM backend is available.

Changes in this PR:

  • Make the configure check non-fatal (a warning is printed)
  • At runtime, disable opacche if no backend is available, in the same way we disable opcache by default on CLI

cc @krakjoe @derickr

@arnaud-lb arnaud-lb marked this pull request as ready for review August 2, 2025 09:49
@arnaud-lb arnaud-lb requested a review from dstogov as a code owner August 2, 2025 09:49
Copy link
Member

@derickr derickr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

zps_startup_failure("No available SHM backend", NULL, accelerator_remove_cb);
/* Do not abort PHP startup */
return SUCCESS;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Whitespace that isn't consistent with rest of switch cases. :)

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.

3 participants