I'm using nginx webserver and I'm writing a script that includes file creation but www-data is not able to create the file even I give permission in the sudoers list.
Inside my sudoers file:
www-data ALL=(ALL) NOPASSWD: /usr/bin/php, /usr/bin/python
I even tried to give ALL permission but still it can't able to create the file via browser..
www-data ALL=(ALL) NOPASSWD: ALL
My simple script just want to create a file and it works via terminal but not on browser..
<?php
$data = "test";
shell_exec("sudo /bin/echo $data > /var/www/api/v3/monitoring/iam/temp");