简体   繁体   English

达到'100'的最大功能嵌套级别,升级到Laravel 5.1后中止

[英]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- 所以,解决方案是 -

  1. Disable the extension 禁用扩展程序
  2. Increase the nesting level of the extension 增加扩展的嵌套级别
  3. Increasing max_nesting_level in laravel 增加max_nesting_level在laravel

In detail 详细地

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"
  • Path should be different from PC to PC 路径应该与PC不同
  • Adding an # before the line is a comment 在行之前添加#是注释

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.

相关问题 达到最大功能嵌套级别“ 100”,从而中止了Laravel 5.1 - Maximum function nesting level of '100' reached, aborting Laravel 5.1 具有Sentinel 2的Laravel 5.2-达到最大功能嵌套级别'100',正在中止 - Laravel 5.2 with Sentinel 2 - Maximum function nesting level of '100' reached, aborting 达到最大功能嵌套级别'100',中止 - Maximum function nesting level of '100' reached, aborting PHP Singleton:达到最大功能嵌套级别“ 100”,正在中止 - PHP Singleton : Maximum function nesting level of '100' reached, aborting Yii2错误:达到“100”的最大功能嵌套级别,正在中止 - Yii2 error:Maximum function nesting level of '100' reached, aborting PHPUnit显示达到的最大函数嵌套级别'100',正在中止 - PHPUnit displays Maximum function nesting level of '100' reached, aborting 达到最大嵌套等级100,中止! - PHP - Maximum Nesting Level of 100 Reached, Aborting! - PHP 创建新的中间件时,Laravel抛出:“达到最大功能嵌套级别'100',正在中止!” - When creating a new middleware, Laravel throws: “Maximum function nesting level of '100' reached, aborting!” PHP致命错误:函数最大嵌套级别达到'100',正在中止! 在Laravel - PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in Laravel 如何修复laravel 5.2这个错误“达到'100'的最大函数嵌套级别,正在中止!”? - How to fix laravel 5.2 this error "Maximum function nesting level of '100' reached, aborting!"?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM