Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

exec() disabled when PHP-FPM enabled

Discussion in 'EasyApache' started by imgdat, Dec 2, 2016.

Tags:
  1. imgdat

    imgdat Registered

    Joined:
    Dec 2, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Root Administrator
    Turning on PHP-FPM in the MultiPHP Manager for a domain will disable exec() and possibly other functions. In the INI settings there is only
    PHP:
    disable_functions =
    If PHP-FPM is turned off then exec() will work again. How can exec() be enabled with PHP-FPM?
     
  2. imgdat

    imgdat Registered

    Joined:
    Dec 2, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    California
    cPanel Access Level:
    Root Administrator
    Oops I should have looked at more posts about PHP-FPM.

    I edited /opt/cpanel/ea-php70/root/etc/php-fpm.d/blah.domain.tld.conf to have
    php_admin_value[disable_functions] = passthru,shell_exec,system and restarted PHP-FPM with /etc/init.d/ea-php70-php-fpm restart

    Now exec() works. However if PHP-FPM is turned off and on again it overwrites the conf file. Is there a way to make this setting persistent?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,885
    Likes Received:
    1,814
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see you were able to address the issue. Disabling PHP-FPM and then enabling it again will reset any custom PHP-FPM configuration values for the specific domain name. Feel free to open a feature request if you'd like an additional option to preserve those settings:

    Submit A Feature Request

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. i-Strategi

    i-Strategi Member

    Joined:
    Mar 14, 2016
    Messages:
    8
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Denmark
    cPanel Access Level:
    DataCenter Provider
    imgdat's solution worked fine, but for a single domain.

    How do i make this setting global? So that i dont have to go into each domain on my webserver, and remove "exec" from php_admin_value[disable_functions] ?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,885
    Likes Received:
    1,814
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is discussed on the following thread:

    Enabling PHP-FPM forces disable_functions

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    i-Strategi likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice