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

后端 未结 12 1341
梦谈多话
梦谈多话 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:15

    You dont need a .bat file just set the options in the task scheduler:

    So here i've just pointed to the php.exe and then in the arguments the

    -f fullpath2PHP file

    The important bit is the run in part - this should be the folder your php sits in. so for example:

    File location -f c:\inetpub\wwwroot\runthisplease\myFile.php Run in c:\inetpub\wwwroot\runthisplease\

    You can test this by creating a windows shortcut (but you cannot schedule a shortcut link)

提交回复
热议问题