Hi,
Keep in mind that enabling shell_exec could be a security risk.
Edit the php.ini
file for your php version and mode (cli and/or fpm) and remove shell_exec
from disable_functions
directive.
Example for php 8.2 version:
CLI: /etc/php/8.2/cli/php.ini
FPM: /etc/php/8.2/fpm/php.ini
Before removing shell_exec:
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pc
ntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtim
edwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
After:
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pc
ntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtim
edwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,proc_open,popen
After that, restart php service.
systemctl restart php8.2-fpm