Enable Opcache
Summary
In regards to the development branch...
Opcache is installed but not enabled. In php.ini (in the base image), zend_extension = opcache
is explicitly commented out. The Dockerfile for this project adjusts the config but it is never enabled.
Steps to reproduce
- Build/run the image
- Check configuration for opcache in the container
docker exec drupal /usr/local/bin/php -i | grep opcache
- Look for
opcache.enable
What is the current bug behavior?
Opcache is not enabled. There are very few results (opcache.enable is not apparent)
What is the expected correct behavior?
Several results including:
opcache.enable => On => On
Relevant logs and/or screenshots
Possible fixes
RUN { \
echo 'zend_extension=opcache'; \
echo '[opcache]'; \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
-
zend_extension=opcache
enables the module -
[opcache]
is a label for the module -
opcache.fast_shutdown=1
is no longer available - https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.fast-shutdown
Definition of Done
If the Drupal image has Opcache enabled by default.
Edited by Brian Beversdorf