I am trying to shutdown my RaspberryPi running Raspbian from a php script running on lighttpd webserver.
shell_exec("sudo /sbin/shutdown -h now 2>&1");
lighttpd ALL=(ALL) NOPASSWD: /sbin/shutdown to my /etc/sudoers file and checked that
Defaults !requiretty is set.
I still get "sudo: no tty present and no askpass program specified" when running the script.
Can somebody please help me? Thanks!