Next let's take a look at a windows scheduled cmd command line to run the PHP file instance. Here we mainly use the windows scheduled task function.
In Windows, you can use php.exe to execute the PHP file, and then write the command to bat for scheduled execution, which is much more reliable than the browser's timed refresh.
The path of php.exe and the path of the PHP file to be executed (the Code is as follows ):
D: \ Program Files \ wamp \ bin \ php \ php5.4.6 \ php.exe D: \ Program Files \ wamp \ www \ phpinfo. php
Save it as a bat file and you can use windows to schedule tasks. You can use the-h parameter to check whether php.exe is running.
> On the windows Server, use the built-in task plan in combination with bat or use a specific browser to regularly execute php or refresh
Method 1:
Task Plan and bat cooperation
1. Add a scheduled task or write a script in the background of zhimeng.
2. Create a text document, enter the bat script command, and modify the txt extension to bat.
The content format is as follows:
@ Echo off
Rem disable echo
Start C: \ "Program Files" \ "Internet Explorer" \ ipolice.exe http://www.skyhome.cn
Rem uses a browser to open the url http://www.bKjia. c0m
Ping 127.1-n 10> nul
Taskkill/im chrome.exe/f
Rem 10 seconds (the unit is seconds later). Execute the chrome.exe process to close the browser (chrome is used by default)
3. Run the bat script regularly according to the required rules using the winows scheduler tool.