Can PHP scripts continue to run even if the user closed the browser?

后端 未结 7 1510
日久生厌
日久生厌 2020-12-09 15:46

For example, there is a very simple PHP script which updates some tables on database, but this process takes a long time (maybe 10 minutes). Therefore, I want this script to

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 16:34

    A server-side script will go on what it is doing regardless of what the client is doing.

    EDIT: By the way, are you sure that you want to have pages that take 10 minutes to open? I suggest you to employ a task queue (whose items are executed by cron on a timely basis) and redirect user to a "ok, I am on it" page.

提交回复
热议问题