How to create cron job using PHP?

前端 未结 12 1496
一整个雨季
一整个雨季 2020-11-21 05:50

I\'m new to using cron job. I don\'t even know how to write it. I have tried to search from internet, but I still don\'t understand it well. I want to create a cron job that

12条回答
  •  执笔经年
    2020-11-21 06:06

    $command = "php ".CRON_PATH.php ";
    if(substr(php_uname(), 0, 7) == "Windows"){
    pclose(popen("start /B ". $command, "r"));
    }else{
    shell_exec($command ." > /dev/null &");
    }

提交回复
热议问题