xdebug.max_nesting_level

让人想犯罪 __ 提交于 2019-12-11 23:11:48

问题


I have to run a function more than 5000 time. I have setted xdebug.max_nesting_level = 10000

but it says problem loading page on firefox.

what is the max limit for xdebug.max_nesting_level and how can I solve this problem.

Please help me, thanks in advance.


回答1:


max_nesting_level has nothing to do with how many functions you call, but how many nested levels of function calls you have. max_nesting_level protects things like:

function a()
{
    a();
}

a();

Without Xdebug's max_nesting_level, this will make PHP crash because it runs out of stack space.

The max limit for the setting depends on he operating system, but in general anything over 2500 seems to be too high.

In order to make sure Xdebug's max_nesting_level isn't hit during running of your script, you probably need to change how your code works (ie, don't do nesting or recursive function calls). Because I do no know your code, I of course can't say whether you might just have hit a bug in it.

cheers, Derick




回答2:


Like @Dreick said, your problem is not in the nesting. To track down your problem you have to allow errors display like below, as mentioned in this answer :

display_errors = on
display_startup_errors = on


来源:https://stackoverflow.com/questions/9121699/xdebug-max-nesting-level

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!