title: execute shell command with php
body: <p>im trying to execute a bash script with a <code>php/html</code> button to wake my nas.</p>
  
  <pre><code>&lt;form action="" method="POST"&gt;
      &lt;input type="submit" value="Wake NAS" name="zero" /&gt;
  &lt;/form&gt;
  &lt;?php
    if (isset($_POST["zero"])){
      #echo "Hello World!";
      shell_exec("/var/www/html/wakenas.sh &amp;");
    }?&gt;
  </code></pre>
  
  <p>"Hello World" is printed when button is pressed.
  but code won't be executed.
  the <code>wakenas.sh</code> looks like this and works if i execute it over shell</p>
  
  <pre><code>#!/bin/bash
  etherwake -D "BC:5F:F4:09:E1:07"
  echo "why!?!?!" &gt; "/var/www/html/works.txt"
  exit 1
  </code></pre>
  
  <p><code>wakenas.sh</code> has all rights</p>
  
  <p>Maybe you guys know why it wont be executed.</p>
  
  <p>thanks in advance</p>