This article mainly introduces the PHP time to perform task Setup method, very simple, there is a need for small partners under the reference.
Today, a buddy of mine asked me this question. He has an IIS server that is scheduled to execute a scanned PHP script, this How to do it every hour, the following is the settings of Windows
1 in Control Panel, double-click the Task Scheduler to open the Windows Task Scheduler window.
2 Double-click Add Task, open Task Scheduler Wizard. Click Next.
3) Click Browse, select the program to run
4 Enter the plan name and choose Daily
5 Set start time, select Daily, start date. Next.
6 Enter the password, which is the password for the system's username (by default). Next
7 Select to open advanced properties for this task when the click completes.
8 in the Advanced Properties window, select the Schedule tab and select the Advanced
9 The Advanced Plan option, tick the repeat task, duration: set to 24 hours.
10 can be up to an hourly update, 24 hours a day to work.
Then we continue to work on how to support the timed execution of the script, so we're going to write a script like Test.bat
My PHP installed to D disk, with the Php-cgi.exe
The code is as follows:
D:
CD PHP
Path to Php.exe d:/wwwroot/dingshi.php//timed script files
We can test dingshi.php.
The code is as follows:
File_put_contents ("a.php", "Test");
We double-click Test.bat, and then look at the a.php is not written to test, our scheduled task to run the program is Test.bat this will automatically execute!
The above is the PHP time to carry out the task of the set method, very simple, small partners free expansion on it, I hope you can enjoy