how to do a linux reboot from php file
I have a user brftv on my linux system and I have www-data that runs the nginx. from the terminal I can let my brftv user run sudo /sbin/reboot and it works fine since I added the following to my /etc/sudoers file's "#user privilege specification" section: brftv ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff www-data ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff But when my php file runs the following code, nothing happens exec('nohup sudo -u brftv /sbin/reboot'); I added the www-data line to the etc/sudoers above in case it was necessary when running the above exec() (even