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
Why did you put -u brftv in there? That makes your PHP script try to run the reboot as your user, which won't work. Only root can reboot the system. Remove it.
-u brftv
reboot