How do I run a PHP script using windows schedule task?

后端 未结 12 1334
梦谈多话
梦谈多话 2020-11-27 02:46

I have installed localhost/server in my machine and I need to run a php script using windows schedule task. how do I add path in \"Actions\" tab in schedule task / cofigure

12条回答
  •  一向
    一向 (楼主)
    2020-11-27 03:04

    Locate the php.exe executable on your system and pass it the name of the script file using the -f parameter.

    Example:

    C:\Xampp\php\php.exe -f C:\Xampp\htdocs\my_script.php
    

    Reference:

    • Introduction to using PHP on the command line
    • PHP command line options

提交回复
热议问题