I'm running rsync from a php script using backtick operators. It's running as an apache user.
In /etc/sudoers, I've set
#Defaults requiretty
Cmnd_Alias REPORTS = /usr/bin/rsync
apache ALL = NOPASSWD: REPORTS
In the error log, I'm getting these errors
sudo: can't stat /var/run/sudo: Permission denied
sudo: no tty present and no askpass program specified
Also, not that the rsync path is correct, and so is the rsync command in php. I can run the command as root, also if I add NOPASSWD to another user, i can sudo and run the same command.