如何让Cronjob执行PHP脚本运行超过30秒? [英] How do you get a Cronjob executing a PHP script to run longer than 30 seconds?
本文介绍了如何让Cronjob执行PHP脚本运行超过30秒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将它重写为每天运行时间超过30秒的cron?此外,我需要编辑 cron中的
目录说些什么?在浏览器上运行时间超过30秒;在外壳,它运行也很好。但作为cron设置任务,它在30秒后死亡。我在1and1分享托管。 .htaccess
或 php.ini
.php
How can I rewrite this into a cron that will run every day for longer than 30 seconds? Also, do I need to edit the .htaccess
or php.ini
file in the cron.php
directory to say something? Over the browser it runs just fine for longer than 30 seconds; over the shell, it runs just fine too. But as a cron set task, it dies after 30 seconds. I'm on 1and1 share hosting.
0 12 * * * php5 /this/is/the/file/cron.php
推荐答案
使用此语法启动php:
Use this syntax to start php:
php -c /path/to/another/php.ini /this/is/the/file/cron.php
然后,您可以在不同的 php.ini 中指定不同的超时code>文件。
Then you can specify a different timeout (or no timeout) in a different php.ini
file.
这篇关于如何让Cronjob执行PHP脚本运行超过30秒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文