Scheduled task execution PHP script

Source: Internet
Author: User
The scheduled task execution PHP script project contains a script for sending emails. you need to read unsent emails from the database every two minutes and then send them out. I am running it in the browser. However, because you need to keep running, you want to use windows scheduled tasks for scheduled execution.
The bat file is written as follows:

D: \ wamp \ bin \ php \ php5.4.3 \ php.exe-q D: \ wamp \ www \ cron \ mailqueue-2min.php

However, if the code is executed, the message always fails to be sent.
Ask the question. What is the difference between php.exe execution and browser running?


Reply to discussion (solution)

-F should be used for the parameter.

D: \ wamp \ www \ cron \ mailqueue-2min.php in the reqiure or include Please use absolute address, is this problem!

D: \ wamp \ bin \ php \ php5.4.3 \ php.exe D: \ wamp \ www \ cron \ mailqueue-2min.php
Remove the-q in the middle.

The problem is solved, not the parameter problem. it is the configuration file problem. in the wamp environment I use, there are two INI files. the configuration in both files must be changed.

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.