在Windows 2008服务器中为php文件安排任务

时间:2021-01-02 02:28:30

i have shared hosting on windows 2008 server and one project in php.

我在Windows 2008服务器和php中的一个项目上共享托管。

actually i want to run one php file once in a day automatically...

实际上我想自动一天运行一个php文件...

i want to run one schedule task once in day.

我希望每天运行一次计划任务。

      any php code, jquery or ajax 

for information. i have access to ftp to up load files to my domain but i don't have sever access and its windows 2008 server.

供参考。我有权访问ftp以将文件加载到我的域,但我没有服务器访问权限及其Windows 2008服务器。

how can i run schedule task in php on windows 2008 server?

我如何在Windows 2008服务器上的PHP中运行计划任务?

Thanks

谢谢

1 个解决方案

#1


0  

If you don't have access to the server where you can set a schedule job then below are your probable options:

如果您无法访问可以设置计划作业的服务器,则以下是您可能的选项:

  1. Create a php file on server W(windows2008) then if you have a free hosting account at server L(Linux) where you can setup cron job, then creating a CURL to access server W would do.

    在服务器W(windows2008)上创建一个php文件然后如果你在服务器L(Linux)上有一个免费的主机帐户,你可以设置cron作业,然后创建一个CURL来访问服务器W会做。

  2. If your page is access often the creating a JS script with setTimeout("myAjaxFunction", 10000) would also do but it's an awkward approach as you assumed that user browser open accessing yoursite somewhere else.

    如果您的页面经常访问,那么使用setTimeout(“myAjaxFunction”,10000)创建一个JS脚本也会这样做,但这是一种尴尬的方法,因为您假设用户浏览器在其他地方打开访问yoursite。

#1


0  

If you don't have access to the server where you can set a schedule job then below are your probable options:

如果您无法访问可以设置计划作业的服务器,则以下是您可能的选项:

  1. Create a php file on server W(windows2008) then if you have a free hosting account at server L(Linux) where you can setup cron job, then creating a CURL to access server W would do.

    在服务器W(windows2008)上创建一个php文件然后如果你在服务器L(Linux)上有一个免费的主机帐户,你可以设置cron作业,然后创建一个CURL来访问服务器W会做。

  2. If your page is access often the creating a JS script with setTimeout("myAjaxFunction", 10000) would also do but it's an awkward approach as you assumed that user browser open accessing yoursite somewhere else.

    如果您的页面经常访问,那么使用setTimeout(“myAjaxFunction”,10000)创建一个JS脚本也会这样做,但这是一种尴尬的方法,因为您假设用户浏览器在其他地方打开访问yoursite。