title: Run Bash Command from PHP
body: <p>I have a bash script, that I run like this via the command line:</p>
  
  <pre><code>./script.sh var1 var2
  </code></pre>
  
  <p>I am trying to execute the above command, after I call a certain php file.</p>
  
  <p>What I have right now is:</p>
  
  <pre><code>$output = shell_exec("./script.sh var1 var2");
  echo "&lt;pre&gt;$output&lt;/pre&gt;";
  </code></pre>
  
  <p>But it doesn´t work. I tried it using <code>exec</code> and <code>system</code> too, but the script never got executed.</p>
  
  <p>However when I try to run <code>shell_exec("ls");</code> it does work and <code>$output</code> is a list of all files.</p>
  
  <p>I am not sure whether this is because of a limitation of the VPS I am using or if the problem is somewhere else?</p>