Does browser stop/crash halts script execution?

后端 未结 4 2029
长情又很酷
长情又很酷 2021-01-18 07:43

I mean, 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?<

相关标签:
4条回答
  • 2021-01-18 08:06

    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).

    0 讨论(0)
  • 2021-01-18 08:07

    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 讨论(0)
  • 2021-01-18 08:13

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

    0 讨论(0)
  • 2021-01-18 08:33

    Depends on ignore_user_abort() setting

    0 讨论(0)
提交回复
热议问题