The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to prevent timeout during a loop?

I have a loop that gets the images from a specified folder (user uploads) and then creates thumbnails for them. The problem I've been having lately is that sometimes the script times out before it gets through all of the uploads.

What command is used in php to tell the script to finish executing one thing and then start executing the next as two seperate processes so that it doesn't time out while executing the loop?

The loop wouldn't start the next execution until it is finished the previous one. You could try changing a couple of the PHP configuration settings at the time of script execution. Add the setting changes about the code you will be using.

PHP Code:

set_time_limit(0);
ini_set('max_execution_time', '360');

# this one shouldn't be necessary
ini_set('max_input_time','360');

# if this done via a form post you will also need
ini_set('upload_max_filesize','5M');
ini_set('post_max_size','5M');
ini_set('memory_limit', '100M');

My apologies, I guess I didn't explain myself correctly. What I want to do is figure out a way to make each loop execute as if it's a brand new php page... for instance, in WHM, when you create a new account, each step appears to process seperately. How is that done?

Sounds like you're talking about multi-threading. If I recall correctly I don't think this is possible w/ PHP. You might be able to execute a shell script server side when the call is made to perform your desired functions however I'm not sure what your permissions are etc...