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

Add opcache.preload_user for php 7.4 #120

Closed
wants to merge 2 commits into from
Closed

Add opcache.preload_user for php 7.4 #120

wants to merge 2 commits into from

Conversation

iLexN
Copy link

@iLexN iLexN commented Oct 27, 2020

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 the env.

@csandanov
Copy link
Member

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

@iLexN
Copy link
Author

iLexN commented Nov 20, 2020

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.

csandanov added a commit that referenced this pull request Nov 20, 2020
@csandanov
Copy link
Member

csandanov commented Nov 20, 2020

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.

@csandanov csandanov closed this Nov 20, 2020
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