Scheduled tasks in Windows Execute PHP file method

Source: Internet
Author: User

Scheduled tasks in Windows Execute PHP file method
Scheduled Tasks, Windows

Using our windows planning tasks to implement the timing of PHP file method, there is a need to learn friends can refer to.

Method one, executing in cmd

How is it easy to execute PHP commands in Windows like PHP under the liunx command (execute PHP files under Dos)?

The solution is fairly straightforward, as long as the PHP project belongs to the directory such as: My project file: d:\web\www\, so I just jump path added to the system variable inside the OK, in order to facilitate the paste here: D:\web\www\;D: \web\mysql\bin\;D: \web\php\;

Right-click My Computer-"properties-" advanced-"environment variable re-system variables-" edit path,

Add the php.ini file path, reboot the server, and turn off cmd.

To start executing PHP files:

Has the effect of ha .... With

If you want to be in any directory can be executed in cmd MySQL, the mysql\bin\ directory test to the PATH environment, restart MySQL, shut down CMD can


Method two, build a. bat file and copy the following code to the

D:\web\php\php.exe "D:\web\www\XXXX\trunk\src\crontab\userlist.php" into the Test.bat file,

Then in the computer's "Control Panel-" task plan-"Add a task plan"

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.