How-To Modify PHP-FPM Configuration Directives in EasyApache 4
[Moderation Notice: This thread was forked from ]
I am having an issue with my solution to #1. It seemed to work, but then I noticed I got a formatting error:
php-fpm.yaml" file and did not apply any custom values.For more information about the correct formatting of custom values, read our Custom Templates
I use PHP 7.2 and PHP-FPM Ondemand, have formatted it several different ways in my php-fpm.yaml file, but even if it restarts without the error, I get a 503 site error:
1)
emergency_restart_threshold = 5
emergency_restart_interval = 1m
process_control_timeout = 10s
2)
pm_emergency_restart_threshold = 5
pm_emergency_restart_interval = 1m
pm_process_control_timeout = 10s
3)
pm.emergency_restart_threshold = 5
pm.emergency_restart_interval = 1m
pm.process_control_timeout = 10s
4)
pm_emergency_restart_threshold: 5
pm_emergency_restart_interval: 1m
pm_process_control_timeout: 10s
Any idea on how to format this for PHP 7.2?
-
I seem to be stuck with how to edit the those settings. If I manually put them into the file (/opt/cpanel/ea-php72/root/etc/php-fpm.conf), it gets erased when I rebuild them (/scripts/php_fpm_config --rebuild "domain=domain.com), and they are lost: emergency_restart_interval = 60 emergency_restart_threshold = 5 process_control_timeout = 10 But the settings do seem to be working there. I have tried many ways to add these to my .yaml file so that this will not happen, but each way I have tried results in an unresponsive server--503 errors. /var/cpanel/userdata/site/domain.com.php-fpm.yaml In the config file it says to edit the settings in the WHM interface, but when I am there I see no way to do this: 57983 Any help with this would be appreciated. 0 -
Hello @celiac101, Thanks for sharing the additional information. The PHP-FPM Global directives are configured separately from the PHP-FPM Pool directives. To modify the value for a PHP-FPM configuration directive, it's important to first browse to the Configuration Values of PHP-FPM document: emergency_restart_threshold emergency_restart_interval To modify the values for both of these Global directives, create the /var/cpanel/ApachePHPFPM/system.yaml file and populate it with the following lines: --- emergency_restart_threshold: 10 emergency_restart_interval: 1m
Feel free to replace "10" and "1m" with your own values. After saving the file, run the following command to apply the changes to the PHP-FPM configuration files:/scripts/php_fpm_config --rebuild
Note: If you see an error message in this command's output, verify no Global directives exist in the following Pool directive configuration files: /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml /var/cpanel/userdata/$username/$domain.tld.php-fpm.yaml Let me know if this helps. Thank you.0
Please sign in to leave a comment.
Comments
3 comments