Run a PHP script once every minute

前端 未结 3 1562
执笔经年
执笔经年 2020-12-19 08:50

I need to execute my PHP code every minute. Is there any way to do that?

3条回答
  •  青春惊慌失措
    2020-12-19 09:10

    You can run PHP code from the command line. e.g., if your PHP folder is in PATH:

    php.exe C:\mycode\myfile.php
    

    You can then set this up as a scheduled task in windows. Side note: be aware that certain things don't exist (and something exist in their place), e.g. Apache or IIS objects, as well as the full range of HTTP stuff.

提交回复
热议问题