Skip to content
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

Additional opcache settings: blacklist_filename and optimization_level #138

Open
bramcordie opened this issue Feb 16, 2021 · 1 comment
Open

Comments

@bramcordie
Copy link

bramcordie commented Feb 16, 2021

Hi, I'm looking for a proper way to set the following opcache settings that are not supported by environment variables out of the box:

opcache.optimization_level=0x7FFEBFFF
opcache.blacklist_filename=/var/www/html/opcache-blacklist

I did get the blacklist filename working by mounting an additional docker-php-custom.ini file, with the exact 2 lines above, in my docker-compose.override.yml file:

version: '3.1'

services:

  php:
    volumes:
      - ./docker-php-custom.ini:/usr/local/etc/php/conf.d/docker-php-custom.ini

I checked phpinfo() which show the expected blacklist filename path.

then I looked at opcache.optimization_level and it seems stuck at 0. Even if I don't try to override, it is set to 0 which is a weird default to begin with? I would expect a bitmask value like the PHP docs suggests: 0x7FFEBFFF, see: https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.optimization-level

Tested with the following php image tags: 7.4-dev-4.18.6 and 7.4-dev-4.20.0 on both nginx or apache.

@bramcordie
Copy link
Author

opcache.optimization_level getting stuck at 0 was caused by xdebug as also mentioned in the archlinux tracker. In hindsight this might be obvious but hopefully this comment might save someone else the time of figuring this out.

It would still be nice to set both opcache.optimization_level and opcache.blacklist_filename with environment variables.

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

No branches or pull requests

1 participant