Long running PHP scripts

Long running PHP scripts

If we have a PHP script that may run for longer than 30 seconds (eg - looping through lots of database data), we can start our code as follows:

<?php
set_time_limit(0);
?>

This will give the php script potentially infinite running time. In some cases, we might want to add this too which has the script continue running even if the browser is closed:

ignore_user_abort();

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.