duandai7601 2015-01-31 04:05
浏览 112
已采纳

无限循环 - 忽略错误并继续?

I create the code for the infinite loop like this:

<?php
    while(1) {
        "some code"
    }
?>

Now the problem is that some times the internet connection goes down. Sometimes fatal errors occur. That's why the loop process stops. I want to run the loop forever - ignore the all the errors, warnings and notices, and run the loop forever. How do I do this?

  • 写回答

1条回答 默认 最新

  • douping1581 2015-01-31 05:35
    关注

    you can increase server timeout for running script

    in php.ini file

    max_execution_time=-1 
    

    PHP

    if(set_time_limit (-1))
    {
        while(1)
        {
            "some code";
        }
    }
    else
    {
        echo "error occured";
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度