title: PHP shell_exec() doesn't work but commands work from console
body: <p>I'm following <a href="https://github.com/markomarkovic/simple-php-git-deploy" rel="nofollow noreferrer">this guide</a> for deploying my website via Git, and I'm running into some problems with PHP shell_exec() or exec(). 
  The deploy script runs several commands such as <code>git</code>, <code>whoami</code>, <code>which git</code>, <code>rsync</code>, etc. All of these commands work when I'm logged in as the server user.</p>
  
  <p>However, when I hit the php script that is supposed to run these commands, they don't work. 
  <code>whoami: command not found</code></p>
  
  <p><code>git: command not found</code></p>
  
  <p><code>rsync: command not found</code></p>
  
  <p><code>which: command not found</code></p>
  
  <p>I can fix this by providing the path to the commands (eg. <code>/usr/bin/whoami</code> => <code>myuser</code>) but some commands like <code>/usr/bin/which rsync</code> still don't work. (That one gives me <code>/usr/bin/which: no rsync in (/bin)</code>)</p>
  
  <p>These aren't vital to getting the project working, but I'd still like to know if there's some sort of permissions issue or something I'm doing wrong. Does anyone have any insight here?</p>