Learn about Centmin Mod LEMP Stack today
Become a Member

PHP-FPM Wordpress php shell_exec() is disabled?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by adzkii, Apr 28, 2020.

  1. adzkii

    adzkii Member

    38
    1
    8
    Apr 15, 2020
    Ratings:
    +3
    Local Time:
    2:38 AM
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.10
    • PHP Version Installed: 7.4
    • MariaDB MySQL Version Installed: 10.3

    how do i enable shell_exec() on php?
    [​IMG]
    may i know what other php functions are disabled by centminmod?

    cheers
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,731
    10,196
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,804
    Local Time:
    11:38 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    By default PHP shell_exec() is disabled in /usr/local/etc/php-fpm.conf via entry
    Code (Text):
    php_admin_value[disable_functions] = shell_exec

    If you need shell_exec for your PHP scripts, just disable it by commenting out that line with a semi-column
    Code (Text):
    ;php_admin_value[disable_functions] = shell_exec

    you can use sed to replace via command
    Code (Text):
    sed -i "s|^php_admin_value\[disable_functions\] = shell_exec|;php_admin_value\[disable_functions\] = shell_exec|" /usr/local/etc/php-fpm.conf
    

    and then restart nginx and php-fpm
    Code (Text):
    nprestart