我想用此PHP命令覆盖“ / etc / network / interfaces”文件
exec('sudo echo -e "# Include files from /etc/network/interfaces.d:\nsource-directory /etc/network/interfaces.dauto eth0\n\nauto eth0\niface eth0 inet static\naddress \nnetmask \ngateway \n\n" > /etc/network/interfaces');
我可以在“ /var/log/apache2/error.log”中看到日志:sh:1:无法创建/ etc / network / interfaces:权限被拒绝
如何允许PHP覆盖此文件?