【问题标题】:php files not running in windows server 2003 scheduled tasksphp 文件未在 Windows Server 2003 计划任务中运行
【发布时间】:2014-10-08 23:54:07
【问题描述】:

我尝试在 Windows Server 2003 中运行带有计划任务的 abc.php 文件。
我尝试从命令 promt ;
schtasks /create /sc minute /mo 1 /tn "mytask" /tr "C:\PATHOFPHP\php.exe C:\wamp..\abc.php" kbd> 仍然无法正常工作
我也尝试了另一种方式
start->programs->accesories->system tools ->scheduled tasks. 不工作。
在我的任务窗口中;
运行:php5.3.13\php.exe c:\wamp\www..\abc.php 开始于:C:\wamp\bin\php\php5.3.13

【问题讨论】:

    标签: php scheduled-tasks windows-server-2003


    【解决方案1】:

    您需要创建一个.bat 文件并按照您的计划运行它:Open -> Control panel - > Administrative Tools - > task Scheduler

    下面是一个例子:

    @echo off
    start "abc.php running" "C:\Program Files (x86)\PHP\v5.3\php.exe" -f C:\wwwroot\reminder-email.php
    

    【讨论】:

    • 我运行的东西没有错误消息,但在我的 php 代码中,代码必须邮寄给我,但邮件没有到达我的手中
    • 我可以看看代码吗(抱歉回复延迟)
    • 你的意思是php代码?我试图发送,但从这里发送的时间很长
    • 在您的问题下方添加出错的PHP代码的相关部分并详细解释您的新问题,请不要将其添加为答案!
    • 你理解错了,没用。当我手动运行它时,它可以工作。但是按照您的方式,它不起作用。所以我的php代码没有问题。
    【解决方案2】:

    试试这个,

    打开->控制面板->管理工具->任务调度器

    打开任务计划程序并创建新的基本任务,如下图所示:

    2) after that select Daily and click next
    3) Specify the start date and end date click next
    4) Action program click next
    

    5) Start a Program browse Program/Script, here in this section create one test.bat file with the following content as below and browse here.
    
    @echo off
    "c:\Program Files\Internet Explorer\iexplore.exe"
    sleep1
    start "webpage name" "http://www.google.com/"
    

    在上面的例子中我使用的是google页面,你可以使用你的php页面。

    6) click finish
    

    【讨论】:

    • @echo off "c:\Program Files\Internet Explorer\iexplore.exe" sleep1 start "webpage name" "localhost/abc/def.php" 我把这个写到 bat 文件中,它成功了!谢谢你..
    猜你喜欢
    • 2011-08-04
    • 2020-09-17
    • 2011-03-08
    • 2010-09-14
    • 1970-01-01
    • 2010-12-30
    • 2010-09-22
    • 2013-03-26
    相关资源
    最近更新 更多