Maximum function nesting level of '100' reached, aborting after upgrading to Laravel 5.1

Emeka Mbah picture Emeka Mbah · Jun 12, 2015 · Viewed 22.8k times · Source

I'm getting this error message in my Laravel application after I upgraded to Laravel 5.1.

FatalErrorException in Dispatcher.php line 200:
Maximum function nesting level of '100' reached, aborting!

enter image description here

This issue occurs on some URLs of my app. I have done dozens of composer update but issue still persist. Any suggestion at all will be appreciated

Answer

Emeka Mbah picture Emeka Mbah · Jun 15, 2015

Issue is caused by default xdebug.max_nesting_level which is 100.

The workaround for now is to increase xdebug.max_nesting_level to a certain level say 200 or 300 or 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

ini_set('xdebug.max_nesting_level', 120);

.........

define('LARAVEL_START', microtime(true));