如何在Windows上创建一个像cron这样的调度程序 [英] How to make a scheduler like cron in PHP on Windows Server
问题描述
我是Windows Server的初学者,我已经根据客户端要求在Windows服务器上设置我的项目,但我遭受一个严重的问题,我的客户端要同时上传文件与不同的用户在同一网站上,我还验证来自服务器上的上传文件的电子邮件。这就是我想要一个调度程序像 cron
。任何具有如何在Window Server上的PHP中为 cron
调度程序的知识不能 xampp
。
I am beginner in Windows Server, i had setup my project on windows servers as per client requirement but i am suffering a serious problem that is my client want to upload file parallel on same time with different user on same website and i am also verify the email from uploaded file on server. That is way I want to make a scheduler like cron
. Any one who has knowledge about how to make scheduler for cron
in PHP on Window Server not xampp
.
推荐答案
假设你需要执行一些控制器方法来做一些内务处理工作,你需要设置一个 cron
作业(例如,每30分钟一次)。为此,您可以使用Windows中的任务计划程序。
Assuming that you need to execute some of your controller methods to do some housekeeping work, you need to set up a cron
job (at, say, every 30 minutes). For this, you use task scheduler from Windows.
您配置频率和一切,然后就是您设置运行哪个命令的点。在这里,您需要下载 wget for windows 。
You configure frequency and everything, then comes the point where you set which command to run. Here, you need to download wget for windows.
您将输入执行命令,如下所示:
You will enter the execution command like this:
C:\WINDOWS\wget.exe -q -O nul http://yoursite/controller1/method1
如果你只是想运行一个页面,然后修改为:
If you just want to run a page, then modify as per:
C:\WINDOWS\wget.exe -q -O nul http://yoursite/somepage.php
这篇关于如何在Windows上创建一个像cron这样的调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!