Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/47462-prevent-browser-timeout/
Share on other sites

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!

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.