How to keep a php script from timing out because of a long mysql query

后端 未结 5 1795
盖世英雄少女心
盖世英雄少女心 2020-12-29 11:07

I have an update query being run by a cron task that\'s timing out. The query takes, on average, five minutes to execute when executed in navicat.

The code looks ro

5条回答
  •  攒了一身酷
    2020-12-29 11:41

    I had the same problem somwhere, and "solved" it with the following code (first two lines of my file):

    set_time_limit(0);
    ignore_user_abort(1);
    

提交回复
热议问题