WampServer Fatal error - Maximum function nesting level

From TNG_Wiki
Jump to navigation Jump to search

You may get this error message on a Windows system only (e.g. WampServer).

"Fatal error: Maximum function nesting level of '100' reached, aborting! in R:\wamp\www\tng\tngconnect.php on line 107"


This error message is misleading (tngconnect.php) as this is a failure related to the Windows PHP XDEBUG Extension (php_xdebug-x.x.x-x.x-vcxx.dll).

This failure may be fixed by changing a line in the configuration file php.ini located in the Apache directory.

Finding the php.ini configuration file

Edit file php.ini located in this directory:

[Your Wamp Directory]\bin\apache\[Apache Directory]\bin\php.ini

(e.g. R:\wamp\bin\apache\apache2.4.27\bin\php.ini)

Editing the php.ini configuration file

In the file php.ini, look for section [xdebug], and comment this line by adding a semicolon (;) at the beginning of the line.

;zend_extension ="r:/wamp/bin/php/php5.6.31/zend_ext/php_xdebug-2.5.5-5.6-vc11-x86_64.dll"

This will prevent the XDEBUG Extension to load.

Save the file and restart all WampServer services (Apache, MySql, etc.)

That's it!

Alternate solution for developers

If you need and use the XDEBUG Extension, you may increase the maximum nesting level by adding (or changing) this line in [xdebug] Section and then set a maximum nesting level higher than the number displayed in the error message.


Save the file and restart all WampServer services (Apache, MySql, etc.)

Sample [xdebug] Section after changes

; Comment the line below to disable xdebug extension
;zend_extension ="r:/wamp/bin/php/php5.6.31/zend_ext/php_xdebug-2.5.5-5.6-vc11-x86_64.dll"
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="r:/wamp/tmp"
; This line is required to set the maximum nesting level when zend_extension is active


Do not copy and paste this sample [xdebug] section into your php.ini file without changing the drive letter and directory paths according to your own configuration.