laravel定时任务在windows系统执行php artisan schedule:run

新建run_cron.bat文件,用于执行laravel的任务调度。 cd d D:phpStudy2PHPTutorialWWWwebsitephp artisan schedule:run 1>

新建run_cron.bat文件,用于执行laravel的任务调度。

cd /d D:\phpStudy2\PHPTutorial\WWW\website
php artisan schedule:run 1>> storage/cron 2>&1

新建run_cron.vbs,使用vbs调用执行bat文件,防止每次执行定时的时候都弹出cmd命令行。

Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c D:\phpStudy2\PHPTutorial\WWW\website\run_cron.bat",0

新建定时任务,打开计算机管理,在任务计划程序库中,添加定时任务

新建定时任务

Laravel创建定时任务

     运行这个定时任务 run 是运行一次,我们可以用来测试是否成功,work是一直运行,每分钟执行一次,当执行到我们设置的时间就会自动执行。

php artisan schedule:run

php artisan schedule:work

发布者:admin,转转请注明出处:http://www.yc00.com/web/1755002061a5225602.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信