PHP scheduled execution of tasks to set up a detailed

Source: Internet
Author: User
PHP scheduled execution of task settings detailed
One of my buddies asked me this question today, the problem is that he has an IIS server, to schedule a scan of the PHP script, this How to do, every hour, the following is the Windows settings


1) In Control Panel, double-click Task Scheduler to open the Windows Task Scheduler window.


2) Double-click Add Task to open the Task Scheduler Wizard. Click Next.


3) Click Browse, select the program to run


4) Enter the plan name and select Daily


5) Set start time, select Daily, start date. Next.


6) Enter the password, which is the password for the system's user name (by default). Next


7) Select the advanced properties for this task to open when you click Finish.


8) In the Advanced Properties window, select the Schedule tab, select Advanced


9) In the Advanced Plan option, tick the repeat task duration: set to 24 hours.


10) can be updated hourly, 24 hours a day to work.


Then we continue to work out how to support the timing of the script execution, so we have to write a script, such as Test.bat


My PHP is installed on the D drive, using Php-cgi.exe


D:CD phpphp.exe d:/wwwroot/dingshi.php  //The path of the script file executed at timed time

We can test the dingshi.php.


File_put_contents ("a.php", "Test");

We double-click on the Test.bat, and then see if a.php is written to test, our scheduled task runs the program is Test.bat this will be automatically executed!


The above is the PHP scheduled to perform the task of the Setup method, very simple, the small partners free expansion can be, I hope you can like

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.