php - How long does ignore_user_abort(true); persist? -
i made script shouldn't return browser (not echo, print or interruptions of code blank space, ?> <?
, , uses ignore_user_abort(true);
avoid that, once browser window closed, process stops.
thus once script launched, should go till end.
the script designed newsletter, , sends 1 email each 5 seconds, respect spam policies of provider, through mail();
said that, what's happening after 20 minutes working (the total emails 1002 ), script "collapses", no error returned.
hence question: there life time limit scripts running ignore_user_abort(true);
?
edit following suggestion of hanky (here below) put line:
set_time_limit(0);
but issue persists
so whilst ignore_user_abort(true);
prevent script stopping after visitor browses away page, set_time_limit(0);
remove time limit. can change php memory_limit in php.ini or setting php_value memory_limit 2048m
in .htaccess file.
in order list default max_execution time can run echo ini_get('max_execution_time');
(seconds) or echo ini_get('memory_limits');
(megabytes).
this being said, sounds php scripts better suited being run cli. using command line can run php scripts, sounds better suited usage seems, have described, script doesn't need serve web browser. method better php scripts run in order operate background process rather return front-end user.
you can run file command line running php script.php
or php -f script.php
.
Comments
Post a Comment