I am coding a php script that does some back end stuff and needs to run every 8 hours or so. The script takes a while to execute. For the hell of it, I tried it from my brow
As default, PHP scripts timesout after 30 seconds which can be overridden by editing the PHP.ini or by adding this at the top of your script.
set_time_limit(0);
This sets unlimited execution time to your script, that is, it never ends unless the scripts finish execution, or the server goes down, or the file is deleted or any fatal error comes.
Additionally,
You can add this to your script and open it in your browser to initiate the script, and it will run as if you are opening it in a browser and keeping the browser open.
ignore_user_abort();
It simply runs the script in background. These both would be useful for you.
ADD : When the scripts are run from the commandline,Cli, the default timeout is 0.(No Timeout)