header
 
     
 
pixel
pixel pixel

Long running PHP scripts

If you have a PHP script that may run for longer than 30 seconds (eg - looping through lots of database data), start your code as follows:
<?php
set_time_limit
(0);
?>
This will give the php script potentially infinite running time. In some cases, you might want to add this too which has the script continue running even if the browser is closed:
ignore_user_abort();

Unhelpful Helpful Rating 4.0 (score out of 5, no. of ratings: 5)
Comments
Comment by John A Cove on 2005-04-14
Wicked, thanks

Comment by John on 2005-06-05
I think this is dependant on Safe Mode being Off in PHP... i may be wrong. Great tip .. thanks

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image