获取错误最大函数嵌套级别 200 [英] getting error maximum function nesting level of 200 reached
问题描述
我目前正在研究 Symfony
、Rest API
.我是这个 framework
的新手.我已经正确安装了 Symfony
.现在我已经安装了 FriendsOfSymfony
包,一切正常,但是当我点击 logout
时,出现以下错误
I am currently working on Symfony
, Rest API
. I am new to this framework
. I have installed Symfony
correctly. and now I have installed FriendsOfSymfony
bundle, every thing is going fine but when I am clicking on logout
then I am getting following error
Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\xampp\htdocs\Symfony\vendor\twig\lib\Twig\Loader\Filesystem.php on line 6010
经过一番搜索,我找到了在 php.ini
中设置 xdebug
的解决方案,将限制设置为 200 而不是 100,然后我收到以下错误,
After some searching I found a solution to set xdebug
in php.ini
, to set set limit 200 instead of 100, then I am getting the following Error,
Fatal error: Maximum function nesting level of '200' reached, aborting! in C:\xampp\htdocs\Symfony\vendor\twig\lib\Twig\Loader\Filesystem.php on line 6010
我也完全看不到 symfony 的演示.请大家告诉我如何解决这个问题?
Totally I am unable to see a demo of symfony also. Please guys tell me how Can I come out of this problem ?
推荐答案
尝试检查调用堆栈.也许你有一个无限循环.停用 xDebug 或将 php.ini 中的最大嵌套级别设置得更高:
Try to check the call stack. Maybe you have an ifinite loop. Deactivate xDebug or set the maximum nesting level in the php.ini higher:
xdebug.max_nesting_level=500
这是正常行为.尝试类似:
This is a normal behavior. try something like:
$traceStack = debug_backtrace();
var_dump($traceStack);
$i=0;
foreach($traceStack as $n) {
/* do what you want here */
/*
* $n is an array of:
* 'file' => ..
* 'line' => ...
* 'function' ...
* 'class' => ...
* 'object' => ...
* 'type' => ...
* 'args' => ...
*/
}
重要:不要忘记重启 apache(或 FPM)!
Important: Don't forget to restart apache (or FPM)!
这篇关于获取错误最大函数嵌套级别 200的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!