致命错误:C中超过30秒的最大执行时间: [英] Fatal error: Maximum execution time of 30 seconds exceeded in C:

查看:72
本文介绍了致命错误:C中超过30秒的最大执行时间:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个错误让我很震惊...根本无法得到它

i am badly struck in this error... simply unable to get it

Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\vas1\apriori.php on line 36

我为此功能编写的代码如下:

my code for this function was like:

function combination($member,$num){
  $n = count($member);  

  $total = pow(2, $n); 
  $list =array();

  $k=0;
  for ($i = 0; $i < $total; $i++) {   
    $list[$k]=array();

    for ($j = 0; $j < $total; $j++) {  

        if ((pow(2, $j) & $i)) $list[$k][]=$member[$j];       
    }
    if(count($list[$k])==$num){

      $k++;
    }else{

      unset($list[$k]);
    }
  }
  return $list;
}

第36行是:

 if ((pow(2, $j) & $i)) $list[$k][]=$member[$j];  

推荐答案

正如人们指出的那样,您已经超过了允许的最大脚本运行时间,默认情况下为30秒.

as people have pointed out you have exceeded the maximum allowed script runtime which is by default 30 seconds.

要更改此设置,请添加到脚本的开头:

To change this, add to the beginning of your script:

ini_set('max_execution_time', 300);//for 300 seconds

这篇关于致命错误:C中超过30秒的最大执行时间:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆