I am trying to grant php sudo access (for automated share mounting). I was sucess full at granting php sudo access on one of my systems by adding daemond to the list of sudo's via
su --login -c 'visudo'
so now it contains the daemond like:
daemon ALL=(ALL) NOPASSWD: ALL
but when I try to run a simple php script:
<?php echo "\nfirst: "; echo shell_exec("whoami"); echo "\nsecond: "; echo shell_exec("sudo ls"); ?>
I get the results:
first: daemon second:
That is any time I us shell_exec with sudo in the command nothing is returned or excited. How can I grant php sudo access.