php timeout - set_time_limit(0); - don't work

前端 未结 5 1359
感动是毒
感动是毒 2020-12-15 04:25

I\'m having a problem with my PHP file that takes more than 30 seconds to execute.

After searching, I added set_time_limit(0); at the start of the code,

5条回答
  •  庸人自扰
    2020-12-15 04:42

    This is an old thread, but I thought I would post this link, as it helped me quite a bit on this issue. Essentially what it's saying is the server configuration can override the php config. From the article:

    For example mod_fastcgi has an option called "-idle-timeout" which controls the idle time of the script. So if the script does not output anything to the fastcgi handler for that many seconds then fastcgi would terminate it. The setup is somewhat like this:

    Apache <-> mod_fastcgi <-> php processes
    

    The article has other examples and further explanation. Hope this helps somebody else.

提交回复
热议问题