如何设置我的Linux服务器以每分钟自动执行特定的php脚本?
谢谢。
尝试 cron 作业
在 linux 下,您可以通过指定脚本的完整路径来使用 crontab,例如:
*/2 * * * * /usr/bin/php /home/biji/script.php
或者,如果您将脚本放在 Web 上,则可以使用 wget
*/2 * * * * wget http://yourserver/script.php -O /dev/null
如果你需要更多的企业解决方案,你可以使用zend服务器使用作业队列(但它会很昂贵):
http://www.zend.com/en/products/server/zend-server-job-queue
使用 cron。
参考
- http://www.scrounge.org/linux/cron.html
- http://kevin.vanzonneveld.net/techblog/article/schedule_tasks_on_linux_using_crontab/