且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在计划任务中运行 PHP 文件(Windows 任务计划程序)

更新时间:2022-10-18 16:00:33

Run 命令应该是

C:Path ophp.exe -f "C:Path ofile.php"

来自 php.exe 的命令行帮助:

-f 解析并执行 .

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 FilesApache Software FoundationApache2.2htdocsWEB4w_websitesave.php"

Start in: "C:Program FilesApache Software FoundationApache2.2htdocsWEB4w_website"

It just opens the PHP file in Notepad.

I gave the correct user name and pwd.

Please help me..

The Run command should be

C:Path	ophp.exe -f "C:Path	ofile.php"

From the command line help of php.exe:

-f         Parse and execute <file>.