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
、