使用cron作业在localhost上运行php脚本

使用cron作业在localhost上运行php脚本

本文介绍了使用cron作业在localhost上运行php脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的本地主机上设置一个cron作业,每半小时24小时调用

3) Then I have set up a windows 7 task scheduler to call cron.bat every day.

我欢迎任何关于如何设置cron作业的想法作为我的方法

I welcome any idea on how to set up a cron job as my approach doesn't do anything.

感谢

推荐答案


  1. Crons只能在UNIX系统上使用,而不能在Windows上使用。

  1. Crons are available only on unix systems, not windows.

在调试cron或任何类似的东西时,请为每一分钟或任何可接受的较小频率安排时间,为原始频率。

While debugging cron or anything similar, schedule them for every minute or (any such acceptable smaller frequency), and once they work every minute, only then schedule them for the original frequencies. That will save you some time during debugging.

它不正确地调用。您不必传递 * 中的所有

Its an incorrect call to exec. You don't have to pass all those * in it

做 php.exe 而不是 C:\BitNami\wampstack-5.4.21-0\php -f

您的 .bat 档案目前每天安排,你需要每半小时安排一次。

Your .bat file is currently scheduled daily, you need to schedule it every half hour.

这篇关于使用cron作业在localhost上运行php脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 10:05