i need this PHP function run on background due to timeout error -
i need run whole function in background, because takes long time finish , it's getting timeout on cloudflare server. tried more exec codes run, need $id
works on work.php. trying background whole function may work.
function pancal($id) { for($i = 1; $i < 4; $i++) { _req('http://' . $_server[http_host] . '/work.php?cod=' . $id); } print 'success'; }
you can utilize set_time_limit
function set execution time limits of script.
simply add together set_time_limit(3600) //3600 seconds
, script not time out 1 hour
if parameter set zero, no time limit imposed.
you can read here more: http://php.net/manual/en/function.set-time-limit.php
php timeout exec background-process
No comments:
Post a Comment