Does php execution stop after a user leaves the page?

后端 未结 5 1538
猫巷女王i
猫巷女王i 2020-11-30 04:23

I want to run a relatively time consuming script based on some form input, but I\'d rather not resort to cron, so I\'m wondering if a php page requested through ajax will co

5条回答
  •  星月不相逢
    2020-11-30 05:04

    If the client/user/downloader/viewer aborts or disconnects, the script will keep running until something tries do flush new data do the client. Unless you have used ignore_user_abort(), the script will die there. In the same order, PHP is unable to determine if client is still there without trying to flush any data to the httpd.

提交回复
热议问题