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

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

    At least I tried out some suggestions but it doesn't work so I tried this.

    Use a bat file and schedule to execute that bat file.

    For example in the bat file executephp.bat, write this

    c:\xampp\php\php.exe -f c:\xampp\htdocs\do_something.php

    save that bat file that contains that line.

    Go to windows scheduler and create a new task and in action tab, browse to point that executephp.bat and for start in -> direct to the directory u have that executephp.bat.

    For example if u save the file under C:\xampp\htdocs put that C:\xampp\htdocs in the start in.

    Remember to invoke the script even when the user is not logged on.

    Everything is set and it will execute without problem.

提交回复
热议问题