I need to run command (only one command) as a non root user from cron.
Have tried two versions and both fails;
Cron:
* * * * * php script.php
script.php:
exec("whoami"); // returns 'root'
// version 1
exec("runuser -u www-data -- ls"); // error -> sh: 1: runuser: not found
// version 2
exec("su www-data -c 'ls'"); // error -> This account is currently not available.