Running php script as cron job - timeout issues?

后端 未结 3 1924
甜味超标
甜味超标 2020-12-29 08:17

I am coding a php script that does some back end stuff and needs to run every 8 hours or so. The script takes a while to execute. For the hell of it, I tried it from my brow

3条回答
  •  萌比男神i
    2020-12-29 08:49

    No there are no time limits in php itself when executing php from the command line.

    But there can be other timeouts, like connections to mysql. So if you have a mysql connection in your code, make sure to keep it alive or set your mysql timeout to something high enough to run your code. Another thing: I've seen some webhosting providers killing php apps running more then a few minutes. So make sure your provider does not do that.

提交回复
热议问题