PHP Config Clarification
Currently we have PHP-FPM enabled with Apache configured to use Event MPM. I noticed that on this support topic, it says opcache will not work with suphp handler. That part had me concerned since we would like to use opcache with our applications. This thread, from seven years ago states that if php-fpm is enabled the handler is not used. I tried setting the handlers to none and restarted php-fpm and Apache and it would appear to be correct. Can anyone confirm the handler setting has no effect if fpm is enabled?
Additionally we were looking at Symfony's recommended opcache settings and I have a few additional questions. First, since the fpm pools run as the user, do I need to set the preload_user option? If I do, should it be the user's account name or nobody or something else?
Additionally, is it possible to set memory_consumption options for each pool or does every process/account on the server have to share the same pool?
Thanks in advance for any help you can provide.
-
Hey there! Whenever a handler question comes up I always direct people to our page at https://docs.cpanel.net/ea4/php/php-handlers/ as that has excellent information on all the options and what they do.
It's important to note the PHP-FPM *is* a handler in itself, so if you enable that it becomes the handler and overrides others. You'll see a separate section for FPM in the guide I linked above.
If I'm reading that guide right, it looks like if you plan to use opcache globally then you wouldn't need to set the preload_user value. However, you can always customize the pools for the users using the details here, if you wanted a specific value for one user, for example: https://support.cpanel.net/hc/en-us/articles/1500012059742-How-to-modify-PHP-FPM-settings-for-a-domain-in-WHM
You can also adjust the memory_consumption value per domain, which I tested in a thread here: https://support.cpanel.net/hc/en-us/community/posts/19163651460247-Can-i-set-higher-opcache-memory-limit-for-single-account
Let me know if that helps to clear things up!
0
Please sign in to leave a comment.
Comments
1 comment