PHP error - Xdebug?

Im using the Events Manager plugin. Its throwing an error, which I understand may be related to Xdebug…?

“Fatal error: Uncaught Error: Maximum function nesting level of ‘256’ reached, aborting! in…”

I followed other advice on this forum to turn off Xdebug but it made no difference.

Can anyone suggest another solution? Wordpress, theme, plugins and local all up to date.
Thanks

You’re right that that seems like an Xdebug issue. Can you describe in a little more detail what you’ve already tried?

According to this StackOverflow answer, you’ll need to:

Increase the value of xdebug.max_nesting_level in your php.ini

recursion - Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP - Stack Overflow

For Local, I think you’ll need to edit the file at sitename/conf/php/php.ini.hbs and add a line like this to the [xdebug] section:

xdebub.max_nesting_level=512

After saving the file, stop the site and restart it so that Local can compile that change.

You might need to go higher than 512, but remember that this is basically just a bandaid solution. The fact that the Events Manager has over 256 levels of nested function calls seems odd to me, but on the other hand, I guess that could happen with some complex queries that have lots of WordPress hooks involved.

Thanks Ben. I did go to the /conf/php/php.ini.hbs file, but that file does not contain the line xdebub.max_nesting_level

…so that left me a bit stuck! Any idea why that line isn’t there in the file?

It’s just a setting that we didn’t include, so it’s using the default that xdebug uses. All you need to do is add the line and restart the site in Local!

Thanks Ben.

I added the line with 512, then with 1024, and restarted between each, but it made no difference.

In the end, I found it was being caused by a plugin (Make Elementor Default Editor). So i deactivated that, as it wasn’t essential anyway. Now the problem is gone.

Thanks for your efforts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.