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

后端 未结 7 1543
日久生厌
日久生厌 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:18

    To answer your question directly, see ignore_user_abort

    More broadly, you probably have an architecture problem here.

    If many users can initiate this stuff, you'll want the web application to add jobs to some kind of queue, and have a set number of background processes that chew through all the work.

提交回复
热议问题