如何在计划任务中运行PHP文件(Windows Task Scheduler) [英] How to run a PHP file in a scheduled task (Windows Task Scheduler)
问题描述
如何创建计划的任务来运行PHP文件?
是的,我填写了计划任务中的所有内容,但仍然无法正常工作.
How can I create a scheduled task to run a PHP file?
Yes, I filled out everything in the scheduled task, but it still doesn't work.
运行:"C:\ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs \ WEB \ 4w_website \ save.php"
Run: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website\save.php"
开始于:"C:\ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs \ WEB \ 4w_website"
Start in: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website"
它只是在记事本中打开PHP文件.
It just opens the PHP file in Notepad.
我给了正确的用户名和密码.
I gave the correct user name and pwd.
请帮助我.
推荐答案
运行命令应为
C:\Path\to\php.exe -f "C:\Path\to\file.php"
从php.exe的命令行帮助中:
From the command line help of php.exe:
-f Parse and execute <file>.
这篇关于如何在计划任务中运行PHP文件(Windows Task Scheduler)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!