在PHP中运行shell_exec函数不起作用

run "mumudvb -l" command in the linux terminal has correct output. but in php the output is nothing.like this:

$output = exec('mumudvb -l');

$output = shell_exec('mumudvb -l');

 $output = "" //the output

why this happen?

You cannot use this function because php.ini know it's disabled functions in config file

+Solution: Open your php.ini, find disable_functions and remove your function then restart web server. BTW, becareful because security problem you may have. You should improve your server security

On Linux machines, setting that certain value in php.ini does not always work.

What I did was add the following sudoers group: %admin ALL=NOPASSWD: ALL then make the www-data user run as admin usermod -G admin www-data next, all the commands that you use with shell_exec, prefix them with sudo.