1

i am facing a problem in Cakephp. As it is working fine on Local. here is error

Fatal error: Maximum function nesting level of '100' reached, aborting! in /var/www/tanuki/cake/libs/folder.php on line 261

You can also check this link for more information

Please tell me what was the problem

Prince John Wesley
  • 62,492
  • 12
  • 87
  • 94
Hitu Bansal
  • 2,917
  • 10
  • 52
  • 87
  • 3
    Show the relevant code, not a link. :-) – CodeCaster Oct 31 '11 at 12:22
  • @CodeCaster: there is no code as such for show as it is working fine on local – Hitu Bansal Oct 31 '11 at 12:23
  • Do you know if XDebug is installed on that host? I've also found a related question related to limited function nesting: http://stackoverflow.com/questions/4293775/increasing-nesting-functions-calls-limit. The accepted answer states that XDebug (a debugging extension for PHP) may limit the nesting of functions and that there's no such limitation in PHP itself. And code is always helpful, even if it's running fine locally. ;) – mensch Oct 31 '11 at 12:28
  • @user900553 that it works locally and not on your web server doesn't say much, except for it being poorly tested. You might have a situation on your server that triggers this error, while it isn't present on your local development machine. It can be a variety of things, from folders (not) existing to configuration differences. It's up to you to determine where the problem lies, we can't do that for you. The error you're getting is a symptom, not the source. – CodeCaster Oct 31 '11 at 12:36
  • @CodeCaster: $this->Room->recursive = 0; $this->set('rooms', $this->paginate()); this is a code . i dont think you can find error in this code :) – Hitu Bansal Oct 31 '11 at 12:44

2 Answers2

2

Something is causing recursions, and your goal is to find what it is. The easiest way is to debug... set a break point in /var/www/tanuki/cake/libs/folder.php on line 261, run the script, and analyse call stack for something unusual, when it hits breakpoint.

On the other hand, recursion might be caused by internal errors. You can override system and your custom error handlers with appError() method on AppController class:

public function appError($method, $messages)
{
   die('Application error: called handler method '.$method);
}

This will give you a hint on what missing part (eg. file or class of component, element, etc.) caused recursion.

Greg Smirnov
  • 1,592
  • 9
  • 9
1

This error only means that your call stack has reached the maximum number of 100 items and won't go any further. It's not the actual problem.

Make sure your debug setting is set to 0 in your config/core.php and also check your webservers' error_log for any underlying problems that may be causing this.

Oldskool
  • 34,211
  • 7
  • 53
  • 66