简体   繁体   English

通过 cron 作业执行长时间运行的 php 脚本

[英]Execute Long running php scripts via cron jobs

I have a php script that updates a database.我有一个更新数据库的 php 脚本。 It takes round 5 minutes to complete.大约需要 5 分钟才能完成。 I want to set it to run automatically via cron job on cpanel but it don't execute via cron job.我想将它设置为通过 cpanel 上的 cron 作业自动运行,但它不通过 cron 作业执行。

Is there any time execution limit on cron jobs or is there any other effective way to automate this process on server? cron 作业是否有任何时间执行限制,或者是否有任何其他有效方法可以在服务器上自动执行此过程?

set_time_limit() might help you set_time_limit()可能对你有帮助

documentation文档

you can use supervisor to keep command line tasks running您可以使用主管来保持命令行任务运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM