Manual:$wgMaxTemplateDepth

Details
Maximum recursion depth for templates within templates. The current parser adds two levels to the PHP call stack for each template, and xdebug limits the call stack to 256 by default. So this should hopefully stop the parser before it hits the xdebug limit.