I have a simple scripts that create folder for every user that sign up, it works perfectly fine on local but after pushing to live server it does not work... I discovered that it require sudo
password. I google around and all suggested that I should edit sudoer by running visudo but nothing work.
$sudoPassword = \Config::get('app.sudoPassword');
$sudo = "echo $sudoPassword | sudo -S ";
$createDir = "cd ../../merchants && mkdir ".$merchant->identity." && cd ".$merchant->identity;
echo exec($createDir);
my question is, how should I make exec to run as root? I'm using centOS in digitalocean