Closed josiasmontag closed 6 months ago
What! Quite weird that opcache is not installed by default, this should be prioritized
What! Quite weird that opcache is not installed by default, this should be prioritized
Gimme a break guys! I'll get it merged π
:^) what the hell, last time I checked with php -m
I think I saw opcache listed there and I'm pretty sure I've configured opcache for my needs.
Yes it's already here, it seems it's coming as default module since PHP 5, you just have to configure it.
> docker run --rm serversideup/php:8.2-fpm php -m | grep "Zend OPcache"
[18-Mar-2024 08:42:37] NOTICE: fpm is running, pid 64
[18-Mar-2024 08:42:37] NOTICE: ready to handle connections
[18-Mar-2024 08:42:37] NOTICE: systemd monitor interval set to 10000ms
Zend OPcache
Zend OPcache
[18-Mar-2024 08:42:38] NOTICE: Terminating ...
[18-Mar-2024 08:42:38] NOTICE: exiting, bye-bye!
> docker run --rm serversideup/php:8.2-cli php -m | grep "Zend OPcache"
Zend OPcache
Zend OPcache
Maybe itβs not on the beta?
Indeed it is enabled in stable but not in the beta.
β ~ docker run --rm -it serversideup/php:8.2-fpm-nginx php -i | grep opcache.enable
opcache.enable => On => On
opcache.enable_cli => Off => Off
opcache.enable_file_override => Off => Off
β ~ docker run --rm -it serversideup/php:beta-8.3-fpm-nginx php -i | grep opcache.enable
β ~
At this moment you can just add RUN install-php-extensions opcache
to your own Dockerfile.
I'm working on this now if anyone is available to give me quick feedback:
Opcache will be installed.
π The question:
I am just worried about PHP developers running into local issues regarding cache. It will be easy to disable it via an ENV setting (which i will document.
Thoughts? π€
I'd prefer it enabled, but for your sanity, probably disabled.
Enabled since itβs main use is for production servers
I put this out into the Twitterverse and it's not a strong opinion one way or the other.
Someone proposed DISABLED by default with a notice on how to enable it: https://twitter.com/NikSpyratos/status/1775524350004785259
I think that's a good approach thoughts?
i used to have development and production images, each one with his default tools, like xdebug in dev, opcache in prod. Documenting the path to customize these settings etc.
Just shipped this to the beta
images. π₯³
Everything is fully documented on the live site and I put a notification if it's enabled or disabled.
PHP_OPCACHE_ENABLE
is set to 0
by default
A production ready and optimized PHP image should really have the
opcache
extensions installed by default.The performance gains are massive (especially for Laravel) and it is just installing the extension.