Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is causing a "Maximum function nesting level" error in Symfony 2.1 and Twig?

Tags:

twig

symfony

I have a project on Symfony 2.1. After updating composer components (Gedemo, Symfony core, Doctrine, Twig, etc..) I have the following error:

Fatal error: Maximum function nesting level of '100' reached, aborting! in /var/www/{path}/vendor/twig/twig/lib/Twig/Token.php on line 78 

I have PHP 5.4. What can cause this error?

like image 444
ZhukV Avatar asked Nov 03 '12 20:11

ZhukV


1 Answers

Find the xdebug.ini file:

$ locate xdebug.ini /etc/php5/conf.d/20-xdebug.ini /etc/php5/mods-available/xdebug.ini 

In my case the file is /etc/php5/conf.d/20-xdebug.ini. Open it and add this line:

xdebug.max_nesting_level = 1000 

Don't forget to restart the FPM server.

like image 91
Elnur Abdurrakhimov Avatar answered Sep 22 '22 01:09

Elnur Abdurrakhimov