📅  最后修改于: 2022-03-11 14:54:53.281000             🧑  作者: Mango
# add sudoers for www data to execute without pass
sudo vi /etc/sudoers
www-data ALL=(ALL) NOPASSWD: ALL
# execute with sudo
shell_exec('python3 script.py')