Long running background PHP script blocks other PHP pages until it is finished

前端 未结 2 1237
误落风尘
误落风尘 2020-12-03 14:59

I made a long script in PHP as such:

ignore_user_abort(true);
set_time_limit(0);

It runs perfectly in the background even if I close the pa

2条回答
  •  死守一世寂寞
    2020-12-03 15:30

    As mentioned in comments, Sessions are the problem - this is because the session file is locked.

    Use session_write_close() in your long-running script to unlock the session file, but note that you cannot use $_SESSION variables in that particular script afterwards.

提交回复
热议问题