I am using php shell_exec to run a command from jQuery but it keeps timing out.
So my jquery is as follows.
var send = {
url: $(this).data('url')
}
$.ajax({
type: "POST",
url: "<?php echo base_url(); ?>index.php/upload",
data: send,
//dataType: "json",
//timeout: 8000,
beforeSend: function() {
},
success: function(response) {
console.log(response);
},
error: function () {
alert('error');
}
});
This then calls a function which runs shell_exec
function upload(){
$output = shell_exec("wget {$_POST['url']} 2>&1");
echo "<pre>" . $output . "</pre>";
}
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)
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.
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.
Any suggestion on how to debug further?