How to run a PHP file in a scheduled task (Windows

2019-01-01 15:18发布

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.

Run: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website\save.php"

Start in: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website"

It just opens the PHP file in Notepad.

I gave the correct user name and pwd.

Please help me..

7条回答
初与友歌
2楼-- · 2019-01-01 15:59

The Run command should be

C:\Path\to\php.exe -f "C:\Path\to\file.php"

From the command line help of php.exe:

-f         Parse and execute <file>.
查看更多
登录 后发表回答