问题
I am not sure if it is a bug or configuration error but I keep getting ajax requests "canceled" at exactly 120 seconds. No http response code given.
The server side is running on a LAMP stack and the php max_execution_time is set to 240 seconds using mod_php5
Oddly enough, if I request the same page without ajax, it won't timeout after 120 seconds.
Early tests shows that firefox does the same thing.
Can anyone help with this bug/annoyance?
Sample code
set_timeout_limit(o);
sleep(1000);
回答1:
try to add timeout: xxx
(in ms) to your AJAX call
example:
$.ajax({
url: "test.html",
timeout: 240000,
context: document.body,
success: function(){
$(this).addClass("done");
}
});
回答2:
I already had your problem!I use set_time_limit(0) but my script stop after 630 Seconds!i put long time on this problem and i figure out that server firewall kill my process!maybe your problem is this too!if you access to your server WHM go to Process manager and take a look at your process! ;)
来源:https://stackoverflow.com/questions/6578834/chrome-timeout-ajax-request-after-120-seconds