Closed iLexN closed 3 years ago
Could you please explain the use case? we run fpm from www-data user by default, why would you want to set it to root and preload something from a different user? and what user would it be? wodby? Running fpm from root is not safe and not recommended, which is why I'm hesitant about merging this
i am trying the Preloading for php 7.4, using wodby/drupal-php:7.4
in the docker-compose.yml , after add a env variable PHP_OPCACHE_PRELOAD: /file-path/preloader.php
, the container cannot start and have a error Fatal Error "opcache.preload_user" has not been defined
after define the opcache.preload_user=wodby
in the .ini file, it work.
Ok, I see, it just needed a user specified, we now set it by default to the same user www-data
we use for fpm. Thank you for reporting this.
https://www.php.net/manual/en/opcache.preloading.php
preload.php is an arbitrary file that will run once at server startup (PHP-FPM, mod_php, etc.) and load code into persistent memory. If PHP will be run as root (not recommended), the opcache.preload_user value can specify an alternate system user to run the preloading. Running preloading as root is not allowed.
this patch added the
opcache.preload_user
can config from theenv
.