Php scheduled execution task settings _ PHP Tutorial

Source: Internet
Author: User
Detailed description of php scheduled execution task settings. This article describes how to set php scheduled execution tasks. it is very simple and can be used as a reference for other users. Today, a buddy asked me how to set a scheduled php execution task.

This article mainly introduces how to set php scheduled task execution, which is very simple. For more information, see.

Today, a buddy asked me this question. The problem is that he has an iis server that regularly runs a php script for scanning, below are windows settings

1) double-click the task scheduler in the control panel to open the Windows Task Scheduler window.

2) double-click add task to open the Task Scheduler wizard. Click next.

3) Click browse and select the program to run

4) enter a scheduler name and select Daily

5) set the start time, day, and start date. Next step.

6) enter the password, which is the user name (by default) of the system. Next Step

7) click finish to open the advanced properties of the task.

8) in the advanced properties window, select the schedule tab and advanced

9) in the advanced plan option, select "repeat task". Duration: Set to 24 hours.

10) it can be updated every hour, working 24 hours a day.

Then we will continue to solve how to support the regular execution of scripts, so we will wait for a script to be written, such as test. bat.

I used php-cgi.exe to install PHP on the D drive.

The code is as follows:

D:

Cd php

Php.exe D:/wwwroot/dingshi. php // path of the script file that is periodically executed

We can test dingshi. php.

The code is as follows:

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

Double-click test. bat and check whether a. php has written test. the program running in our scheduled task is test. bat, which will be automatically executed!

The above is the setting of php scheduled task execution, which is very simple and can be expanded freely. I hope everyone will like it.

This article describes how to set the php scheduled task execution method. it is very simple and can be used as a reference for other users. Today, a buddy asked me this...

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.