Jump to content
Sylvio

Urgent matter: Fatal error: Maximum function nesting level of '100' reached

Recommended Posts

Hi,

Out of the blue, I am getting this error:
 

Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\data\My Dropbox\www\showled.com\wire\core\Pages.php on line 628

It happens when I try to 'edit' pages under a certain node


It used to work and I am pretty sure I didn't change anything


Any ideas

Sylvio

Share this post


Link to post
Share on other sites

SORRY, my bad

Has to do with xdebug.

Just raised the xdebug.max_nesting_level to 200 in php.ini and the problem is solved

  • Like 2

Share this post


Link to post
Share on other sites

I encountered the same when changing the the template of a page and saving it:

from the PW log:

2011-12-28 17:36:46: admin:/wcpw/processwire/page/edit/:Error:Maximum function nesting level of '100' reached, aborting! (line 95 of E:\wamp\www\wcpw\wire\core\Data.php)

Setting xdebug.max_nesting_level to 200 in php.ini did solve the problem.

I'm running a default Wampserver (v2.1) and to be honest i didn't even know xdebug was doing anything. How can i know for sure if xdebug isn't interfering with anything or slowing shit down?

Apart from xdebug, does this error have a meaning?

Share this post


Link to post
Share on other sites

I think that xdebug turns on some kind of throttling to prevent memory consumption and such, not 100% sure though.

Share this post


Link to post
Share on other sites

I'm not sure about this one, I've not used xdebug. I will install at the next opportunity and see if I can duplicate it.

Share this post


Link to post
Share on other sites

I think I encountered this one a while ago when I was writing a module that wasn't as optimised as I'd thought at first. Did you install any modules around the same time?

Of course, xdebug might be complaining if multiple pages are saved at the same time, as is the case if you re-order pages for example (I think every page on the same level has to have it's position saved so the same functions will be called then and that could be what it's complaining about).

I ended up not using xdebug as it was more hassle than it was worth and turned on proper PHP error reporting and put PW into advanced mode in the config to get detailed error messages that way.

Share this post


Link to post
Share on other sites

Like i said, apparently wampserver comes bundled with it nowadays, i didn't even know it was doing 'something'.

Anyways, i did some further testing. I'm on Win7 HP, 64 bit, Wampserver 2.1 (php 5.3.4, mysql 5.1.53, apache 2.2.17)

I'm on a vanilla install of PW running from the dev branch. I've only installed the module ImportPagesCSV.

The scenario of when these 'error' messages appear is when i change the template of a page with children an then save that page. For example the default 'About' page with 2 children or my 'News' page which currently has 41 children.

The actual saving does seem to take place because when i next visit the page in the admin the template has changed.

After playing around with xdebug.max_nesting_level setting it appears that 108 is the last value that gives an error. Setting it to 109 and everything is fine and dandy. Adding extra levels of children doesn't seem to affect anything.

From the Xdebug documentation:

xdebug.max_nesting_level

Type: integer, Default value: 100

Controls the protection mechanism for infinite recursion protection. The value of this setting is the maximum level of nested functions that are allowed before the script will be aborted.

After putting the site in debug mode i was able to get more detailed info. See the attached self containing htm file for a complete call stack leading to the 'error'. I don't know what to make of it, maybe it's of some use to Ryan.

Error:
Maximum function nesting level of '100' reached, aborting! 
(line 95 of E:\wamp\www\wcpw\wire\core\Data.php) 

This error message was shown because you are logged in as a Superuser. Error has been logged.

Error:
Maximum function nesting level of '108' reached, aborting! 
(line 162 of E:\wamp\www\wcpw\wire\core\Wire.php) 

This error message was shown because you are logged in as a Superuser. Error has been logged.

error.zip

Share this post


Link to post
Share on other sites

Thanks for the log. The function nesting looks right to me. I can follow the path of functions in the log and it looks as expected, so I guess that means we just need a higher function nesting level than what xdebug provides by default. I would bump it up to at least 200.

Share this post


Link to post
Share on other sites

Thx for checking that there isn't something unexpected happening.

Share this post


Link to post
Share on other sites

Hmm, I got the same problem. How do I change this max_level? I found php.ini and changed these lines:

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 200
 

Is this correct? Even after this I'm getting the same error whenever I open a page with a repeater field.

Edit: Oh, I found that I could edit php.ini by clicking "PHP" in the wamp control panel. However, after changing the value in that to 200 as well, I am still getting this error.. 

Share this post


Link to post
Share on other sites

I haven't ever experienced this error, so maybe there is something else involved, but you have a semi colon at the start of the line which means it is commented out and not used. Try removing the semi colon and also be sure to restart apache to have the changes take effect.

Share this post


Link to post
Share on other sites

Hmm. No luck with anything related to the php.ini. Tried removing that sem-colon, but I think ti's just that the writers of the ini file have a funny preference to put the semi-colons at the start of the line.
 

Thanks for the quick reply. I finally gave up and just deleted "php_xdebug-2.2.0-5.3-vc9-x86_64.dll" in wamp>bin>php>php5.3.13>zend_ext, since I read in different places that one solution is to just disable xdebug. I have no idea what I just did, but it works now... :\ 

Share this post


Link to post
Share on other sites

@ShaltNot: semicolons are definitely comments in INI files, so altering a setting prefixed with semicolon won't affect anything. Also the setting affecting xdebug, as mentioned above, is actually xdebug.max_nesting_level. I haven't used xdebug myself so I'm not sure if it's settings are in php.ini or somewhere else -- it could have it's own config file too.

One more thing to note is that you may have to restart your web server after altering PHP settings. Not 100% sure about this, but as it's a local server that probably won't do much harm either.

Anyway, since your issue seems to be fixed, you may not have to worry about these anymore, just wanted to point these out in case that someone else stumbles upon this same issue.

  • Like 3

Share this post


Link to post
Share on other sites

Hmm, I got the same problem. How do I change this max_level? I found php.ini and changed these lines:

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 200
 

Is this correct? Even after this I'm getting the same error whenever I open a page with a repeater field.

Edit: Oh, I found that I could edit php.ini by clicking "PHP" in the wamp control panel. However, after changing the value in that to 200 as well, I am still getting this error.. 

I also ran into this issue and, in case someone else does too, it might be worth pointing out once again that this is not the value to change.

At the end of the php.ini-file (that you find under the wamp-icon in the task-bar and then by in the menu picking PHP - php.ini) you have the xdebug lines. Just add the line...

xdebug.max_nesting_level = 200

...directly under the [xdebug]-line. After that, things should run smoothly. 

  • Like 4

Share this post


Link to post
Share on other sites

I just created an issue because of 

Fatal error: Maximum function nesting level of '1000' reached,

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By FrancisChung
      Hi there,
      I'm a newbie and I'm trying to learn more about Processwire so I've setup XDebug + PHPStorm to get some real time debugging happening. 

      I've noticed that no matter where i put a breakpoint in any of my php modules, it seems to return the following error.
      Error: __debuginfo() must return an array (line 55 of /Users/FrancisChung/site/Test/templates/head.inc) 
      This error message was shown because you are logged in as a Superuser. Error has been logged.
      I was wondering if fellow Processwire users have a similar setup, and was successful in getting debugging going.
      I've also read this forum post:
      https://processwire.com/talk/topic/1611-yes-debugging-templates-and-core-code-works/
      I'm also aware there's an issue with XDebug and Processwire:
      https://github.com/ryancramerdesign/ProcessWire/issues/1316
    • By SiNNuT
      This afternoon i was setting up a new laptop with Win7 64bits. Having used it in the past with no problems i decided to use Wampserver 2.5 to setup my webdev environment. Having set up an existing project and a vanilla PW install i noticed that some front-end pages took quite long to respond/render. After logging in i also noticed this in the back-end. Especially opening a template edit page performed bad, with a noticeable 2 to 3 seconds delay in the response. This was not at all the case with the live site running the same code base.
      After some hair-pulling i discovered that it was xdebug slowing things down. In Wampserver it comes bundled with the following settings in php.ini (to which i added the max_nesting_level because the default 100 will cause problems in PW) :
      ; XDEBUG Extension 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 xdebug.max_nesting_level = 200 After commenting out all of the above, basically disabling xdebug altogether, my PW installs where back to normal, snappy performance.
      Because i don't use xdebug for debugging or profiling i'm fine with totally disabling it. This might be a tip for people experiencing bad performance in relation to xdebug.
      What i do find surprising is that with the above settings no actual debugging/profiling is enabled. The only thing xdebug needs to do is collect info for it's stack trace. Would this really cause such slowdowns?
    • By gunter
      on a Windows machine, localhost...
      Version 2.4 worked pretty fine, I removed it totally and installed version 2.5 and it did not work - see the errors below!
      the first error went away after putting this into the config.php
      $config->protectCSRF = false;
      $config->sessionChallenge = false;
      $config->sessionFingerprint = false;
      and then I installed again 2.4 and this version worked again perfectly...
      don´t know what to do...
       
      When I try to drag and drop a picture into the picture field this error comes:
      ------"this request was aborted because it appears to be forged."
      and
       
      when I want save a page this error comes:
      Error: Maximum function nesting level of '100' reached, aborting! (line 113 of C:\EasyPHP\data\localweb\projects\ebay2\wire\core\WireData.php)
      This error message was shown because you are logged in as a Superuser. Error has been logged.
    • By jtborger
      Hi,
      Since a few days I get a 'Maximum nesting level reached (100)' at each page I click to edit in de backend. After a refresh F5 it loads.
      It talks about line 114 of Data.php and sometimes 291. I looked up 114 and that part is in the getter.
      It happens not always, but often, and on all kinda templates... Funny thing is that after I F5ed the page, I can edit it directly again after it. A bit strange I think. 
      Any clues where I can start searching for the problem? I cannot imagine it is a bug in PW because then others had major problems so it must have to do with a module I installed or whatsoever. I didn't build one myself and they're all from the repository, no manual additions.
×
×
  • Create New...