title: Executing a bash script from a web page via PHP's shell_exec(), which requires another user's perms?
body: <p>I have a couple of bash scripts on a Centos box which I use to do basic server admin stuff like restart services, etc. I run these as a standard user who is also the scripts' owner.</p>
  
  <p>I tried to run these using shell_exec() in PHP, with the apache user, but it simply doesn't work - I'm guessing it doesn't have enough permissions (even with 775 and being in the correct group!) to run everything I want it to.</p>
  
  <p>I've tried editing the sudoers file giving apache permission to run the script calls but it still doesn't work and has no error messages that I can see.</p>
  
  <p>Any thoughts? How can one trigger a script from a web page which requires a different user to run?</p>