[英]Maximum function nesting level of '100' reached, aborting after upgrading to Laravel 5.1
I'm getting this error message in my Laravel application after I upgraded to Laravel 5.1. 升级到Laravel 5.1后,我在Laravel应用程序中收到此错误消息。
FatalErrorException in Dispatcher.php line 200:
Maximum function nesting level of '100' reached, aborting!
This issue occurs on some URLs of my app. 我的应用的某些网址会出现此问题。 I have done dozens of
composer update
but issue still persist. 我做了几十个
composer update
但问题仍然存在。 Any suggestion at all will be appreciated 任何建议都将受到赞赏
Issue is caused by default xdebug.max_nesting_level
which is 100. 问题是由默认的
xdebug.max_nesting_level
引起的,该值为100。
The workaround for now is to increase xdebug.max_nesting_level
to a certain level say 200 or 300 or 400 现在的解决方法是将
xdebug.max_nesting_level
增加到某个级别,比如200或300或400
I fixed mine by increasing xdebug.max_nesting_level to 120, by adding the line below to bootstrap/autoload.php
in Laravel 5.1 我通过将下面的行添加到Laravel 5.1中的
bootstrap/autoload.php
来将xdebug.max_nesting_level增加到120来修复我的问题。
ini_set('xdebug.max_nesting_level', 120);
......... .........
define('LARAVEL_START', microtime(true));
The problem is created because of 1 PHP extension in Apache- php_xdebug 由于Apache- php_xdebug中有1个PHP扩展,因此创建了该问题
So, the solution is- 所以,解决方案是 -
max_nesting_level
in laravel max_nesting_level
在laravel Option 1- 选项1-
To disable it, you can follow this . 要禁用它,您可以按照此操作 。
If you are using WAMP Server , then you can easily do it by going to php.ini - 如果您使用的是WAMP Server ,那么您可以通过访问php.ini轻松完成 -
And then commit this- 然后承诺 -
zend_extension = "c:/WAMP/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
Option 2- 选项2-
You can increase the limit by this way. 您可以通过这种方式增加限制。
If you are using WAMP Server , then you can easily do it by going to php.ini - 如果您使用的是WAMP Server ,那么您可以通过访问php.ini轻松完成 -
And after zend_extension = "c:/WAMP/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
, there should be something like this- 在
zend_extension = "c:/WAMP/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
,应该有这样的东西 -
[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/WAMP/tmp"
xdebug.show_local_vars=0
Then, just add 1 line there- 然后,只需在那里添加1行 -
xdebug.max_nesting_level=500
Option 3- 选项3-
You can also set this configuration in Laravel autoload.php file. 您还可以在Laravel autoload.php文件中设置此配置。
You can simply add this line in the file (anywhere in the file)- 您只需在文件中添加此行(文件中的任何位置) -
ini_set('xdebug.max_nesting_level', 500);
And you will be done :) 你会完成:)
This issue is due to xdebug extension is enabled, to fix this either you have to disable xdebug extension or edit php.ini file and change xdebug.max_nesting_level to 200 ( as by default this parameter is not included in php.ini and have to add it ) 此问题是由于xdebug扩展已启用,要解决此问题,您必须禁用xdebug扩展或编辑php.ini文件并将xdebug.max_nesting_level更改为200(默认情况下此参数不包含在php.ini中且必须添加它))
like : 喜欢 :
xdebug.max_nesting_level=200 xdebug.max_nesting_level = 200
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.