How can I allow these commands in PHP:
$output = exec('sudo nginx -t 2>&1');
$output2 = exec('sudo /usr/sbin/service nginx reload 2>&1');
I've looked into sudo visudo
in the terminal , but it seems like that will give access to all sudo commands, when I only need the two above.
I guess the reload one isn't so important, as I can just run a cron job to do that.
I am using NGINX, with Ubuntu 20 + PHP 7