Knowledgebase

Portal Home > Knowledgebase > Articles Database > Prevent PHP script from terminating on long ajax request --- Any ideas how?


Prevent PHP script from terminating on long ajax request --- Any ideas how?




Posted by ROMSDJDJ, 09-26-2009, 05:01 PM
Okay, I have a dedicated server and I am trying to prevent a really long (multi-hour) ajax request from terminating. I simply cannot figure out what is making it terminate. Here are the facts: 1) The PHP program handling the request should take many hours to complete, but it prematurely ends (approximately after 110 minutes). 2) PHP max_execution_time, max_input_time are set to unlimited 3) PHP does not run out of memory (currently set at 1GB... It comes nowhere close to that) 4) PHP ignore_user_abort is set to "On" in case firefox sends an abort message after a request takes so long 5) No errors are happening to cause the PHP code to end. The code can be run just fine on the command line. I am guessing it is a setting with Apache, but I have no idea what Apache setting would effectively cause a script to end around the 110 minute mark (give or take a few minutes). It might be browser related, but since ignore_user_abort is set to On I cannot imagine how the browser could possibly signal for the script to end.

Posted by ROMSDJDJ, 09-27-2009, 01:51 PM
Anyone have any tips regarding this issue?

Posted by Crashus, 09-27-2009, 05:10 PM
Check your apache log and maybe system log as well, also can you create simple php script with simple sleep command and run it as well to compare how it will work?

Posted by Ore Stone Radio, 09-28-2009, 10:16 AM
Could be apache restarting, are you running a control panel? That could be restarting it...

Posted by dexxtreme, 09-28-2009, 07:06 PM
What are you doing that requires a multi-hour web request? Anything that long normally isn't done through a single HTTP connection unless there is absolutely no other way to do it.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
ssl error need help (Views: 553)
cpanel Mysql databases (Views: 569)


Language:

Contact us