php 无权限执行Permission denied

发布于 / bug飞 / 0条评论 / Tags: none / 6 次浏览

php 无权限执行shell_exec,加上sudo -S

var_dump(shell_exec("sudo -S git  -C /www/wwwroot/pythons/python_book_gen pull  /www/wwwroot/0.0.0.0_8081/uploads/since_commit.bundle 2>&1"));

提示需要密码:


string(339) " We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for www: sudo: no password was provided sudo: a password is required "

宝塔打开文件/etc/sudoers,加入下面这句

www ALL=(ALL) NOPASSWD: ALL

    评论区(暂无评论)