Jump to content

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


Sylvio
 Share

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

Link to comment
Share on other sites

  • 4 months later...

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?

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 1 year later...

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.. 

Link to comment
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.

Link to comment
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... :\ 

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...

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
 Share

×
×
  • Create New...