Skip to content

Conversation

tianon
Copy link
Member

@tianon tianon commented Aug 7, 2025

In 8.5, opcache is now built-in (and since pretty recently, it's been enabled-by-default in the PHP images too).

See also:

In 8.5, `opcache` is now built-in (and since pretty recently, it's been enabled-by-default in the PHP images too).
@tianon tianon requested a review from a team as a code owner August 7, 2025 23:44
docker-php-ext-enable opcache 2>&1
php -d display_errors=stderr -r 'exit(extension_loaded("Zend OPcache") ? 0 : 1);'
grep -q '^zend_extension=' /usr/local/etc/php/conf.d/*opcache*.ini
# TODO now that opcache is built-in (8.5+), we could use a new zend_extension to test that they're loaded correctly too 🙈
Copy link
Member Author

Choose a reason for hiding this comment

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

To this point, there's something in there called zend_test, but it requires libxml to compile so I didn't want to completely refactor this test just so we keep testing loading zend_extensions, especially since they're so rare.

@tianon tianon merged commit d8c8174 into docker-library:master Aug 7, 2025
6 checks passed
@tianon tianon deleted the php-opcache branch August 7, 2025 23:46

# opcache is pre-built by default at least as far back as PHP 5.5
docker-php-ext-enable opcache 2>&1
php -d display_errors=stderr -r 'exit(extension_loaded("Zend OPcache") ? 0 : 1);'

Choose a reason for hiding this comment

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

this test can stay - https://3v4l.org/auMnl/rfc#vgit.master, it only does not have to/can be enabled manually/explicitly

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh nice, but it's the docker-php-ext-enable opcache bit that this was actually important for (making sure that switched from extension= to zend_extension= transparently), and that broke. In hindsight, it looks like we could've maybe swapped to docker-php-ext-install opcache instead, but that fails like this in PHP 8.5.0beta1:

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20240925/
cp: cannot stat 'modules/*': No such file or directory
make: *** [Makefile:89: install-modules] Error 1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants