Php 在shell_exec中使用sudo命令

Php 在shell_exec中使用sudo命令,php,shell,shell-exec,Php,Shell,Shell Exec,我试图在php文件中使用shell\u exec命令 shell\u exec(日期)工作正常,但shell\u exec(sudo日期)不工作 shell\u exec中的sudo命令是否有任何限制?检查:在shell\u exec中使用sudo时,brwoser中会显示以下消息:“sudo:no tty present and no askpass program specified”不使用sudo。为资源授予适当的权限,以便web服务器可以执行命令,而无需在sudoers中更改sudoTT

我试图在php文件中使用
shell\u exec
命令

shell\u exec(日期)
工作正常,但
shell\u exec(sudo日期)
不工作


shell\u exec中的sudo命令是否有任何限制?

检查:在shell\u exec中使用sudo时,brwoser中会显示以下消息:“sudo:no tty present and no askpass program specified”不使用
sudo
。为资源授予适当的权限,以便web服务器可以执行命令,而无需在sudoers中更改
sudo
TTY设置。