What is the best method for scheduled tasks in PHP

随声附和 提交于 2019-11-27 01:26:58

Have you ever looked at ATrigger? A PHP library is also available to create scheduled tasks without overhead.

Disclaimer: I'm among their team.

The best method for scheduled tasks is beanstalkd with delayed put.

Use your operating system's scheduled tasks facility. crontab on unix, scheduled tasks on windows.

Then we have some more considerations:

  1. Do you want to schedule tasks through a PHP script that adds stuff to the main OS way to schedule tasks? or
  2. Do you want to have a long running php process that will run things at determined times?

For 1, on Unix, you can use something like this module that will do.

For 2, you can use something like this other module.

The easiest way I know is a simple cron job.

http://man.cx/cron

****PHPCron: Running scheduled tasks from PHP on a web server****

But PHPCron is temporarily not available from there. You might need to look somewhere else

One method is to use: http://phpjobscheduler.co.uk/ it will allow you to add/run lots of php scripts, easily manage them and "out of the box" for FREE, its open source.

Best method, not sure, I will leave it upto others to pass judgement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!