title: How to execute .sh files one after another with php
body: <p>I need to run a series of six .sh files on the server.</p>
  
  <p>An example of one of the .sh files:</p>
  
  <pre><code>wget ftp://xxxxxx:xxxxxx@ftp.interhome.com/accommodation.xml.zip
  unzip accommodation.xml.zip
  php accommodation.php
  rm -rf accommodation.xml.zip
  rm -rf accommodation.xml
  </code></pre>
  
  <p>I tried running the following from a php file:</p>
  
  <pre><code>echo shell_exec('sh accomodation.sh');
  </code></pre>
  
  <p>Which was stupid because the file appears to execute repeatedly and I think I've just taken down the server. Whoops.</p>
  
  <p>I've inherited this site and have never used .sh files before. I'm also a php novice.</p>
  
  <p>How would I go about running the files only once and then running the next?</p>
  
  <p>Many thanks</p>