How can I set cron job through PHP script

前端 未结 3 395
闹比i
闹比i 2020-11-30 13:14

How can I set cron job through PHP script.

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 13:48

    Do you know how to set a cron job normally? (outside of PHP, i.e. from a bash script or the command line).

    If so, you just need to use the php function exec to issue the same commands you would have to create the cron job at the command line. One caveat is that there may be permission issues and you have to be really careful about what you put in that exec function (you don't want to pass input from the end user to that function).

提交回复
热议问题