title: Running a bash script in a webpage using php
body: <p>I am trying to run a bash script from an html file using php. I've read this question (<a href="https://stackoverflow.com/questions/7397672/how-to-run-a-sh-file-from-php">how to run a .sh file from php?</a>) and followed it exactly but cannot seem to get it to work.</p>
  
  <p>I have two files in my downloads folder on my mac. These are the file names and their content:</p>
  
  <p>hello.sh</p>
  
  <pre><code>echo hello world
  </code></pre>
  
  <p>test.html</p>
  
  <pre><code>&lt;?php
  echo shell_exec('sh /Users/fred/downloads/thing.sh');
  ?&gt;
  </code></pre>
  
  <p>I ran this command in command line while in the downloads folder:</p>
  
  <pre><code>open test.html
  </code></pre>
  
  <p>This resulted in a blank page being opened in chrome while I was expecting to get a page with "hello word" in it.</p>
  
  <p>Thanks for the help.</p>