1

As always, I today tried (adding) loading a controller on one of my projects with a loader and suddenly had this error

Fatal error: Maximum function nesting level of '100' reached, aborting!

Looked up the internet and landed on the same problem with solutions on StackOverflow

Most of them say, increase the xdebug.max_nesting_level (default being 100) value to a higher number, made sense and I instantly added the value to 256 so now I had this

Fatal error: Maximum function nesting level of '256' reached, aborting!

Same problem but a new level, so went ahead did the same, changed the number to 500 and I again have the same problem but with a higher number

Fatal error: Maximum function nesting level of '500' reached, aborting!

This time I changed the number from 500 to 1000 but now the page won't load, won't show me the error but this page down below which says 'Secure Connection Failed', problem loading the page.

enter image description here

Question 1. How do I resolve this?

Question 2. Read this happens because the limit of Xdebuger has a limit, this was a local server, can this problem of Max function nesting level occur on a production server, I read it does not happen because "PHP doesn't have a limit on nested function calls", Can you confirm?

Question 3. I have an MVC structure, it loads controller using a loader, like in this case the command which brought about this problem was $data ['search'] = $this->load->controller('common/SiteSearchController');, is it okay to load a controller in a controller using a loader?

Mecom
  • 381
  • 3
  • 20

1 Answers1

1

I think you have recursion and in your case increasing nesting leved will not help.

Try comment code in your controller and see happens problem or not. Also please provide more information, which framework/cms you use (or this is custom framework).

yAnTar
  • 4,269
  • 9
  • 47
  • 73
  • it's a custom framework, yes commenting out the last code which caused the whole things runs the programme but my project is not even half made ... and I need not only the last controller which caused this mess but many more. – Mecom Oct 25 '17 at 11:28
  • it was recursion that caused the problem ... thank you for bringing it to my notice – Mecom Oct 26 '17 at 09:20