I found some methods on the Internet to execute PHP scheduled tasks in WINDOWS. one of them was completely written, but unfortunately I did not pass it. Finally, I had to combine the methods of various schools in order to run successfully here. 1. write a PHP program named test. php. the content is as follows:
The code is as follows:
$ Fp = fopen ("test.txt", "a + ");
Fwrite ($ fp, date ("Y-m-d H: I: s"). "success! \ N ");
Fclose ($ fp );
?>
The program writes it boldly. it's okay to use include \ require.
2. create a Bat file named test. bat. the content is as follows:
The code is as follows:
D: \ php \ php.exe-q D: \ website \ test. php
// Change the Directory
3. create a WINDOWS scheduled task:
Start> Control Panel> Task Scheduler> Add Task Scheduler
Browse the folder and select the above bat file
Set the time and password (for WINDOWS login)
Save it.
4. over! Right-click the scheduled task and click "run ".