shell_exec() 没有 reboot/shutdown raspberry pi 的权限

shell_exec() haven't the permission to reboot/shutdown raspberry pi

我尝试使用我的 php 网络应用程序中的 shell_exec() 简单的命令示例 "ls" 有效但 sudo 无效:

shell_exec("sudo reboot");

这是 link :

http://192.168.1.8/controle/webshell.php?commande=sudo%20reboot

但是命令无法执行

有什么帮助吗?

它适用于 /etc/sudoers 中的此修改:

www-data ALL = NOPASSWD: /sbin/reboot, /sbin/halt