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();
