PHP-FPM Enhanced Configuration
At the moment we can't configure PHP-FPM globally for all domains that already have FPM active , we have to change the settings for each domain and only the following settings :
- pm.max_children = 5
- pm.max_requests = 20
- pm.max_spare_servers = 5
Also if we want to add or change new values we have to edit
/var/cpanel/userdata/<CPANEL USERNAME>/<DOMAIN>.php-fpm.yaml for each domains which this is a real pain and will take weeks to do it for a high number of domains.
There are other settings hard coded into cPanel scripts which we can't change :
- php_admin_flag[allow_url_fopen] = on
- php_admin_flag[log_errors] = on
- php_admin_value[disable_functions] = exec,passthru,shell_exec,system
- php_admin_value[error_reporting] = E_ALL & ~E_NOTICE
- php_admin_value[short_open_tag] = on
We need a way / file to set a globally config file so it can apply for all domains new or old ( php-fpm.d/domain.name.conf ) ( disable_functions , error_reporting , timeout , slowlog on , path , etc... ).
Also as for all the domains the general php-fpm config file is generated by cPanel which we can't easily change.
E.g : /opt/cpanel/ea-php56/root/etc/php-fpm.conf ( emergency_restart_interval , emergency_restart_threshold , process_control_timeout ).
This is really needed for tuning , better performance , easy to control.
Hello,
I sure second that! I had a collateral issue with accounts with dated code logging enormous quantities of Deprecated errors despite the fact that E_DEPRECATED was disabled in the global php.ini but not replicated to the PHP-FPM conf file.
The only way to set this was through the file that you mention. But I sure like to have more options.
Before seeing your request I had posted a very similar one. I will let it be and vote for your's also in hope to have more options plus global options available soon.
Dimitris
Hello,
I sure second that! I had a collateral issue with accounts with dated code logging enormous quantities of Deprecated errors despite the fact that E_DEPRECATED was disabled in the global php.ini but not replicated to the PHP-FPM conf file.
The only way to set this was through the file that you mention. But I sure like to have more options.
Before seeing your request I had posted a very similar one. I will let it be and vote for your's also in hope to have more options plus global options available soon.
Dimitris
To change the hard-coded cPanel values, you can create/modify the file /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml and include, for example:
Or something like that. It's been a little while since I've look at cPanel 60's FPM configuration system.
To change the hard-coded cPanel values, you can create/modify the file /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml and include, for example:
Or something like that. It's been a little while since I've look at cPanel 60's FPM configuration system.
In addition, the part about doing this per domain name is also valid.
Is per-virtualhost pools the best way to go about this? Or would per-system user be a better approach? Probably a little too late to do anything about this now, since cPanel has apparently moved ahead with per-virtualhost pools in cPanel 60.
Per virtualhost pools (or per domain) will give you a lot more flexibility but with the added cost of having to setup pools for each and every VirtualHost. How much of that flexibility is really needed? Per-user pool is going to be a lot easier to set up and maintain (you don't have to set up and remove pools every time a subdomain or addon domain is added or removed). I'm not saying one is better than the other, but something to think about.
In addition, the part about doing this per domain name is also valid.
Is per-virtualhost pools the best way to go about this? Or would per-system user be a better approach? Probably a little too late to do anything about this now, since cPanel has apparently moved ahead with per-virtualhost pools in cPanel 60.
Per virtualhost pools (or per domain) will give you a lot more flexibility but with the added cost of having to setup pools for each and every VirtualHost. How much of that flexibility is really needed? Per-user pool is going to be a lot easier to set up and maintain (you don't have to set up and remove pools every time a subdomain or addon domain is added or removed). I'm not saying one is better than the other, but something to think about.
The value of php_admin_value and php_admin_flag set by default by cPanel is a real problem. They should totally stop doing that, it make PHP-FPM really hard to configure. php.ini directive is more that enough to manage php globally. Those directive are not needed.
The value of php_admin_value and php_admin_flag set by default by cPanel is a real problem. They should totally stop doing that, it make PHP-FPM really hard to configure. php.ini directive is more that enough to manage php globally. Those directive are not needed.
I, too, have been stung by this problem. I have just had a run-in with cPanel support techs to "fix" a problem which could really be enhanced and configurable via WHM.
By default, display_errors and display_startup_errors are "on" with PHP-FPM. I need to disable those for security, and have edited the relative auto-generated .conf files several times but of course they are periodically discarded upon updates. I hadn't realised the .yaml files hold true configs hence my support ticket.
The whole pesky problem and drama would/could be avoided by simply enhancing the PHP-FPM features available in WHM. Currently in MultiPHP Manager, we have the option to configure max children, idle timeouts and max requests - it would be nice to see this extended to allow full FPM configurations via WHM.
Better still, if we could edit "master" .yaml templates to apply particular settings globally, and then have a regenerate button to build new .conf files with these settings.
I, too, have been stung by this problem. I have just had a run-in with cPanel support techs to "fix" a problem which could really be enhanced and configurable via WHM.
By default, display_errors and display_startup_errors are "on" with PHP-FPM. I need to disable those for security, and have edited the relative auto-generated .conf files several times but of course they are periodically discarded upon updates. I hadn't realised the .yaml files hold true configs hence my support ticket.
The whole pesky problem and drama would/could be avoided by simply enhancing the PHP-FPM features available in WHM. Currently in MultiPHP Manager, we have the option to configure max children, idle timeouts and max requests - it would be nice to see this extended to allow full FPM configurations via WHM.
Better still, if we could edit "master" .yaml templates to apply particular settings globally, and then have a regenerate button to build new .conf files with these settings.
With PHP-FPM enabled by default on account creation now in pre-release - https://features.cpanel.net/topic/php-fpm-enabled-by-default-on-account-creation#comment-52298
Would we be able to have a possible ETA for this request? It's going to become quite an important and demanded feature for those enabling FPM by default.
With PHP-FPM enabled by default on account creation now in pre-release - https://features.cpanel.net/topic/php-fpm-enabled-by-default-on-account-creation#comment-52298
Would we be able to have a possible ETA for this request? It's going to become quite an important and demanded feature for those enabling FPM by default.
I've also found that if I have existing customizations in a domain's php-fpm.yaml file, those changes are lost if I change the version of PHP used for the domain, such as upgrading from PHP 7.0 to 7.1. So, please make sure to preserve manual changes to these files.
I've also found that if I have existing customizations in a domain's php-fpm.yaml file, those changes are lost if I change the version of PHP used for the domain, such as upgrading from PHP 7.0 to 7.1. So, please make sure to preserve manual changes to these files.
V78 had solved these problems. Just check WHM => Software => MultiPHP manager => System PHP-FPM configuration. If I am not wrong all mentioned errors fixed even the global pool options and a lot mentioned disrespected php ini error log settings which i have also hated. Now its much better than before!
V78 had solved these problems. Just check WHM => Software => MultiPHP manager => System PHP-FPM configuration. If I am not wrong all mentioned errors fixed even the global pool options and a lot mentioned disrespected php ini error log settings which i have also hated. Now its much better than before!
It's true, these improvements were adding in cPanel & WHM Version 78!
https://documentation.cpanel.net/display/78Docs/78+Release+Notes#id-78ReleaseNotes-ConfiguresystemPHPINIdirectivesforPHP-FPMfromWHM'sMultiPHPManagerinterface
If you have any other questions or concerns, don't hesitate to reach out!
It's true, these improvements were adding in cPanel & WHM Version 78!
https://documentation.cpanel.net/display/78Docs/78+Release+Notes#id-78ReleaseNotes-ConfiguresystemPHPINIdirectivesforPHP-FPMfromWHM'sMultiPHPManagerinterface
If you have any other questions or concerns, don't hesitate to reach out!
Replies have been locked on this page!