The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Stop cPanel from overwriting php-fpm settings file.

Discussion in 'General Discussion' started by SpaceCowboy, Mar 22, 2017.

Tags:
  1. SpaceCowboy

    SpaceCowboy Well-Known Member

    Joined:
    Jan 18, 2014
    Messages:
    54
    Likes Received:
    4
    Trophy Points:
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,086
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. SpaceCowboy

    SpaceCowboy Well-Known Member

    Joined:
    Jan 18, 2014
    Messages:
    54
    Likes Received:
    4
    Trophy Points:
    8
    cPanel Access Level:
    Website Owner
    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

    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,086
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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!
     
  5. SpaceCowboy

    SpaceCowboy Well-Known Member

    Joined:
    Jan 18, 2014
    Messages:
    54
    Likes Received:
    4
    Trophy Points:
    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.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,086
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm happy to see the issue is now addressed. Regarding the specific values, it generally depends on the traffic your server receives.

    Thanks!
     
    SpaceCowboy likes this.
Loading...

Share This Page