This Help forum is for issues relates to the latest release (1.7.7). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."
  • Page:
  • 1

TOPIC:

Fatal error in AbstractTheme.php 4 years 5 months ago #1

  • davistom
  • davistom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • davistom
  • Posts: 100
I have a webtrees 1.7.7 installation and when I attempt to display my individual record while logged in as myself, e.g. by selecting the "My individual record" from "My page", I get a fatal error return in AbstractTheme.php. The error message is - Fatal error: Nesting level too deep - recursive dependency? in C:\xampp\htdocs\fotgpwebtrees\app\Theme\AbstractTheme.php on line 1366. "My page" and the "My pedigree" link appear normal.

Looking at the offending code line, I note that it implements a conditional test on $show_user_favorites and my account is configured to display a favorites block in the main blocks area. But disabling the favorites block does not resolve the error. Also, if I configure my individual page with a "RESN none" record so it is accessible to unauthenticated users, my individual page correctly displays its "unauthenticated access" version.
Live site (fotgp.com) - php 5.4, MySql 5.0.96, webtrees 1.7.9
Desktop - Win 7, Xampp 1.8.1, php 5.4.7, MySql 5.5.27, webtrees 1.7.9

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Have you installed/enabled the php-xdebug component on your server?
If yes, what value do you have for the xdebug.max_nesting_level?

Hint: you can find this on the phpinfo page
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #3

  • davistom
  • davistom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • davistom
  • Posts: 100
From phpinfo, the max_input_nesting_level is 64.
Live site (fotgp.com) - php 5.4, MySql 5.0.96, webtrees 1.7.9
Desktop - Win 7, Xampp 1.8.1, php 5.4.7, MySql 5.5.27, webtrees 1.7.9

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
The default value is 256.

Either change it back to the default, or disable the module.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #5

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Ignore that. I misread your answer. You have quoted a different setting. I want xdebug.max_nesting_level
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #6

  • davistom
  • davistom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • davistom
  • Posts: 100
I do not have xdebug configured.

I have both a live, hosting service version of this site and an XAMPP desktop version, with the database at the latter generated by importing a backup of the former, and I have the identical error at both.

I have fiddled around a bit with the code where the error occurs, i.e. the if block starting at line 1366 of AbstractTheme.php. The error occurs while evaluating the last part of the logical test, not by the conditionally executed code in the if block but rather by the !in_array($controller->record, $records) part of the if condition test. A var_dump of ($controller->record displays a Fisharebest\Webtrees\Individual object and a var_dump of $records displays a three element array of Fisharebest\Webtrees\Individual objects.
Live site (fotgp.com) - php 5.4, MySql 5.0.96, webtrees 1.7.9
Desktop - Win 7, Xampp 1.8.1, php 5.4.7, MySql 5.5.27, webtrees 1.7.9

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
The error message "Nesting level too deep - recursive dependency? " comes from the php-xdebug component.

By default, PHP does not have stack limit, and you can have as much recursion as you want. Unless I'm missing something, you *DO* have xdebug installed, and it *DOES* have a limit set.

> The error occurs while evaluating the last part of the logical test

Yes, this is where it is making a function call, which requires an extra level on the stack, which is hitting your limit.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Fatal error in AbstractTheme.php 4 years 5 months ago #8

  • davistom
  • davistom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • davistom
  • Posts: 100
This issue happens at both my GoDaddy hosted live site and my XAMPP desktop site. I can find no indication of xdebug configuration at either. Neither of the strings xdebug or max_nesting_level show up anywhere in the phpinfo.php display at either site. I have no xdebug configuration block in my desktop site php.ini file.

Is it possible to have xdebug configured without anything about it appearing in the phpinfo.php display?
Live site (fotgp.com) - php 5.4, MySql 5.0.96, webtrees 1.7.9
Desktop - Win 7, Xampp 1.8.1, php 5.4.7, MySql 5.5.27, webtrees 1.7.9

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 

Fatal error in AbstractTheme.php 4 years 5 months ago #9

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
I just tried this - a function, which simply calls itself.
$ php -a
php > function x() { return x(); }
php > x();

On a server without xdebug, it runs for a few seconds, until it runs out of memory.
On a server with xdebug, I get an xdebug error at 256 levels of recursion.

> Neither of the strings xdebug or max_nesting_level show up anywhere in the phpinfo.php

So you don't have xdebug installed.

But you definitely have some PHP extension/library on your server that is generating this error message.

Many webhosts run custom builds of PHP. If it was just your godaddy site, then this would be my next guess. But you said it also happens on an XAMPP server, which makes this seem unlikely.

To the best of my knowledge, PHP on its own does not generate "Nesting level too deep" errors.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Last edit: by fisharebest.

Fatal error in AbstractTheme.php 4 years 5 months ago #10

  • davistom
  • davistom's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • davistom
  • Posts: 100
Greg:

I found some stuff on the web about php nesting level errors when using in_array without strict mode comparison on objects. Here is an example. Apparently, doing object comparisons with == vs === is a problem.

I changed the in_array part of the test on line 1366 at my desktop to use strict mode comparison and the error goes away. I haven't moved this change to my live site yet.
Live site (fotgp.com) - php 5.4, MySql 5.0.96, webtrees 1.7.9
Desktop - Win 7, Xampp 1.8.1, php 5.4.7, MySql 5.5.27, webtrees 1.7.9

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum