title: How do I change the shell for php's exec()
body: <p>I want to use php's exec() function on an ubuntu server.
  The problem is, I alway get an error, that the command is not found. For example using </p>
  
  <pre><code>exec("echo 123");
  </code></pre>
  
  <p>prints</p>
  
  <blockquote>
    <p>sh: /echo: not found</p>
  </blockquote>
  
  <p>To me, it looks like php is using the sh shell, when I want to be using bash.
  I tried changing the shell for www-data in /etc/passwd, that didn't help either.</p>
  
  <p>Does anybody have an idea where else the problem might be coming from or how I can change the shell for php's ubuntu user.</p>
  
  <p>Thanks, Timo</p>
  
  <hr>
  
  <p>[EDIT]</p>
  
  <p>Maybe this helps:</p>
  
  <p>I call a bash script from ssh as timo, this script calls a php script, which uses exec. I know, it sounds weird, but it's part of a bigger development environment...</p>
  
  <p>The point is, I'm not ever certain, as which user the script inside exec is executed.</p>
  
  <hr>
  
  <p>[EDIT]</p>
  
  <p>By now I figured out that there must be another rights problem involved.
  Even if I try calling a bash script test.sh (by it's full path!) from within exec, php test.php will just say.</p>
  
  <blockquote>
    <p>sh: /test.sh: not found</p>
  </blockquote>