SOLVED Stop cPanel from overwriting php-fpm settings file.

SpaceCowboy

Well-Known Member
Jan 18, 2014
54
5
8
cPanel Access Level
Website Owner
I need to modify a line on my site php-fpm config, but if i make a change on cpanel it reverts my changes. How can i keep my changes after saving the file using cpanel interface? The file in question is:

/opt/cpanel/ea-php56/root/etc/php-fpm.d/domain.com.conf
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Could you let us know which specific value you have added to that file, and what actions you are taking in cPanel that reverts the change? Also, please post the output from the following command:

Code:
cat /usr/local/cpanel/version
Note that the instructions for making changes to specific domain's pool are documented at:

PHP-FPM and EasyApache 4 - Documentation - cPanel Documentation

In particular, this is the file path to edit:

Code:
/var/cpanel/userdata/[user]/[domain].php-fpm.yaml
This document provides information about how to formulate the custom entries:

Configurations Values of PHP-FPM - Documentation - cPanel Documentation

Then, after making those changes to the YAML file, run the following command:

Code:
/scripts/php_fpm_config --rebuild --domain=domain
This script is documented at:

The php_fpm_config Script - Documentation - cPanel Documentation

Thank you.
 

SpaceCowboy

Well-Known Member
Jan 18, 2014
54
5
8
cPanel Access Level
Website Owner
Hello,

Could you let us know which specific value you have added to that file, and what actions you are taking in cPanel that reverts the change? Also, please post the output from the following command:

Code:
cat /usr/local/cpanel/version
I am commenting this line:
;php_admin_value[disable_functions] = exec,passthru,shell_exec,system

The action that reverts it is:
MultiPHP Manager > Pool Options > Save

cat /usr/local/cpanel/version
11.62.0.17

Note that the instructions for making changes to specific domain's pool are documented at:

PHP-FPM and EasyApache 4 - Documentation - cPanel Documentation

In particular, this is the file path to edit:

Code:
/var/cpanel/userdata/[user]/[domain].php-fpm.yaml
This document provides information about how to formulate the custom entries:

Configurations Values of PHP-FPM - Documentation - cPanel Documentation

Then, after making those changes to the YAML file, run the following command:

Code:
/scripts/php_fpm_config --rebuild --domain=domain
This script is documented at:

The php_fpm_config Script - Documentation - cPanel Documentation

Thank you.
I see. i get very lost when reading docs...i just wanted to enable exec, could you show me how the yaml would look like to change:
This: php_admin_value[disable_functions] = exec,passthru,shell_exec,system
to this: php_admin_value[disable_functions] = passthru,shell_exec,system

This is how it looks like:

---
_is_present: 1
pm_max_children: 5
pm_max_requests: 20
pm_process_idle_timeout: 10
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Try adding this line, and ensure to follow the steps referenced in my previous response:

Code:
php_admin_value_disable_functions : passthru,shell_exec,system
Thanks!
 

SpaceCowboy

Well-Known Member
Jan 18, 2014
54
5
8
cPanel Access Level
Website Owner
Nice! I was able to set other fpm settings that were getting deleted as well! Basically i replaced:
. with _
and = with :

This settings i made them up off of plain trial and error! do they look decent too you? (it's a Quad core with 16 Gb ram)

pm = dynamic
pm.max_children = 9
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 4
pm.max_requests = 250

PS: this is solved btw.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
I'm happy to see the issue is now addressed. Regarding the specific values, it generally depends on the traffic your server receives.

Thanks!
 
  • Like
Reactions: SpaceCowboy