On the internet to find some of the methods of Windows to perform PHP's scheduled tasks, there is a very full, unfortunately, I did not pass the case. At last, I had to synthesize the methods of each gate to succeed in my operation.
1, write a PHP program, named test.php, the content is as follows:
Copy the Code code as follows:
<?
$fp = fopen ("Test.txt", "A +");
Fwrite ($fp, Date ("Y-m-d h:i:s"). "Success has been successful!" \ n ");
Fclose ($FP);
?>
Program boldly write, what include\require, even if used, no problem
2. Create a new bat file named Test.bat, which reads as follows:
Copy the Code code as follows:
D:\php\php.exe-q D:\website\test.php
The corresponding directory to change their own
3. Set up Windows Scheduled tasks:
Start –> Control Panel –> Task Scheduler –> add a task schedule
Browse for Folder Select the bat file above
Set time and password (login to Windows)
Save it.
4, over! You can right-click to schedule the task point "run" to try