regent Posted April 17, 2007 Share Posted April 17, 2007 I have a problem with one of my scripts. Depending on the amount of input, the script can take up to 3 minutes to run, but by then the browser has already timed out. I've tried: set_time_limit(0); ini_set("memory_limit","120M"); at the beginning of the script, and they didn't help at all. Also tried echoing something in my foreach loop, but that didn't help either. Any foolproof way to prevent browser timeout? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/47462-prevent-browser-timeout/ Share on other sites More sharing options...
MadTechie Posted April 17, 2007 Share Posted April 17, 2007 erm.. no maybe you have edit the php.ini file. Quote Link to comment https://forums.phpfreaks.com/topic/47462-prevent-browser-timeout/#findComment-231611 Share on other sites More sharing options...
AndyB Posted April 17, 2007 Share Posted April 17, 2007 Any foolproof way to prevent browser timeout? Better code? If it's taking three minutes to process there must be a better way to do it, even if it means breaking up the overall processing into more than one script. Quote Link to comment https://forums.phpfreaks.com/topic/47462-prevent-browser-timeout/#findComment-231697 Share on other sites More sharing options...
MadTechie Posted April 17, 2007 Share Posted April 17, 2007 Oh that reminds me, what about break the code into parts, and have the code continue from the last part, ie have $start = $_Get['Start']; and after every 500 loops it uses header("location: myself?Start=X"); X being the last loop counter if that makes sence! Quote Link to comment https://forums.phpfreaks.com/topic/47462-prevent-browser-timeout/#findComment-231715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.