开发者

Does browser stop/crash halts script execution?

开发者 https://www.devze.com 2023-01-05 14:27 出处:网络
I mea开发者_开发知识库n, if a php script/page is invoked by a browser and page load/execution is interrupted by user or by browser crash, does script execution continues on the server side?yes, unless

I mea开发者_开发知识库n, if a php script/page is invoked by a browser and page load/execution is interrupted by user or by browser crash, does script execution continues on the server side?


yes, unless you call ignore_user_abort() first. http://php.net/manual/en/function.ignore-user-abort.php


Depends on ignore_user_abort() setting


Depends on ignore_user_abort(). But if you have some loop or poorly written code, it will run until script timeout / max execution time has been reached (~30 seconds).


You can test this very easily:

echo "sleeping 10 seconds...";
sleep(10); //close your browser at this point
error_log("i'm still here!");

Just check your web server error log for the output.

0

精彩评论

暂无评论...
验证码 换一张
取 消