Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

AJAX queries failing for exactly 60 seconds per time

I have a long running ajax request (which I know is long running, and nothing I can do about it).

The ajax command is sent, and I have tried setting the timeout to 0 (infinite) and 90000000 (90 seconds), but dead on 60 seconds of execution the error function is fired and I get a message.

Strangely enough the script is still running on the server, which makes me think it is a browser issue. Im using Chrome 51.0.2704.103m, but need it to work with Chrome, so no cant test in another browser.

Has anyone come across this before, or found a fix?

Thank you in advance
Avatar of tonelm54
tonelm54

ASKER

Just done a test in IE and Chrome, both timeout in 60 seconds.

Out of interest I wrote a simple test:-
<?php
set_time_limit(0);

sleep(90);
echo "Sleep worked";
exit();

?>

Open in new window


Which also causes the same problem, so I know its not my code, just need to figure out a way to stop the page timing out.
What version of PHP are you running? If you are running 5.2 or earlier and have safe mode turned on, the set_time_limit function will not work.
Also, the default max_execution_time is 30 seconds, not 60. Unless your configuration has been changed to 60 seconds, this could be a separate issue. What type of error are you getting?
ASKER CERTIFIED SOLUTION
Avatar of William Nettmann
William Nettmann
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial