Skip to content

Make OPcache non-optional #18961

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 4 commits into
base: master
Choose a base branch
from
Open

Conversation

arnaud-lb
Copy link
Member

Spun of #18660

RFC: https://wiki.php.net/rfc/make_opcache_required

Currently, OPcache is both a Zend extension and a PHP module, but it must be loaded as a Zend extension with zend_extension=opcache.so. The Zend extension then loads the PHP module. Also, OPcache can not be built statically.

This PR makes the following changes:

  • Make OPcache non-optional: OPcache is always built into the binary
  • Since the mechanism for loading builtin extensions supports PHP modules, not Zend extensions: Reversed the roles of the Zend extension and PHP module so that the PHP module loads the Zend extension.

Depends on #18939.

Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

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

In my opinion opcache is not always necessary and even may add troubles in some cases (e.g. routers and media servers). I know dune-hd used PHP in their firmwares. Very probably other players powered by MPD. Installing PHP on routers running under *WRT is a common practice.

Technically I don't see problems in the patch.

@arnaud-lb
Copy link
Member Author

@dstogov do you remember what kind troubles it caused? Was it related to code size, memory usage, or something else? Note that the RFC forces opcache to be built and linked into the binary, but it doesn't set opcache.enable.

@dstogov
Copy link
Member

dstogov commented Jun 30, 2025

@dstogov do you remember what kind troubles it caused? Was it related to code size, memory usage, or something else? Note that the RFC forces opcache to be built and linked into the binary, but it doesn't set opcache.enable.

No. I wrote - "this may add troubles". In the best case this will just waste ~1MB of RAM.

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