title: 500 (Internal Server Error) php shell_exec
body: <p>I am using php shell_exec to run a command from jQuery but it keeps timing out.</p>
  
  <p>So my jquery is as follows.</p>
  
  <pre><code>var send = {
      url: $(this).data('url')
  }
  
  $.ajax({
      type: "POST",
      url: "&lt;?php echo base_url(); ?&gt;index.php/upload",
      data: send,
      //dataType: "json",
      //timeout: 8000,
      beforeSend: function() {
  
      },
      success: function(response) {
          console.log(response);
      },
      error: function () {
          alert('error');
      }
  });
  </code></pre>
  
  <p>This then calls a function which runs shell_exec</p>
  
  <pre><code>function upload(){
      $output = shell_exec("wget {$_POST['url']} 2&gt;&amp;1");      
      echo "&lt;pre&gt;" . $output . "&lt;/pre&gt;";
  }
  </code></pre>
  
  <p>Ok this works fine if the url that is posted for wget get is pulling a small file but if wget is getting a file say over 20mb i get 500 (Internal Server Error)</p>
  
  <p>Things i have checked so far
  all my php setting file upload limit max file size etc memory limit all i have set to the max.</p>
  
  <p>The thing that i dont get is this worked fine locally but on my hosting i get this error, i have contact my hosting media temple and they have said it is out of their scope of support.</p>
  
  <p>Any suggestion on how to debug further?</p>