How to test a cron job in Local Server like WAMP?

后端 未结 10 2070
一生所求
一生所求 2020-12-31 06:06

How to test a cron job in Local Server like WAMP?

相关标签:
10条回答
  • 2020-12-31 06:46

    Windows doesn't have Cron (it is the main task scheduling program for Linux systems). The Windows version for that is the Task Scheduler. This question recommends using the at command.

    So that Cron doesn't have anything to do with the Apache, Mysql, PHP setup I don't think it is possible to reliably test the cronjobs you created for the Linux Cron in windows (maybe with Cygwin).

    0 讨论(0)
  • 2020-12-31 06:47

    <meta http-equiv="refresh" content="0; url=http://localhost/myproject/cron.php" />

    set up a meta referesh immediately: content = 0 every 5 seconds: content = 5

    0 讨论(0)
  • 2020-12-31 06:48

    Try this commnad

    <?php
    
    echo exec('0 13 * * * D:\wamp\bin\php -f D:\wamp\www\be.php');
    
    ?>
    
    0 讨论(0)
  • 2020-12-31 06:49

    Simply run the job from the command line. It is the job that you're wanting to test, not cron itself. If you need to have it execute at periodic intervals to simulate cron, then use the Windows "Scheduled Tasks" facility

    0 讨论(0)
提交回复
热议问题