Difference between revisions of "WampServer Fatal error - Maximum function nesting level"

From TNG_Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
| __TOC__
 
| __TOC__
 
|}
 
|}
You may get this error message on a '''Windows configuration only''' (e.g. WampServer).
+
You may get this error message on a '''Windows system only''' (e.g. WampServer).
  
  
Line 10: Line 10:
 
[[Image:Wampserver-Maximum-function.jpg|border]]
 
[[Image:Wampserver-Maximum-function.jpg|border]]
  
This error message is misleading (''tngconnect.php'') as this is a problem with the Windows PHP XDEBUG Extension (php_xdebug-x.x.x-x.x-vcxx.dll).
+
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.
 
This failure may be fixed by changing a line in the configuration file '''php.ini''' located in the Apache directory.
Line 19: Line 19:
 
'''<span style="color: Blue">[Your Wamp Directory]</span>\bin\apache\<span style="color: Blue">[Apache Directory]</span>\bin\php.ini'''
 
'''<span style="color: Blue">[Your Wamp Directory]</span>\bin\apache\<span style="color: Blue">[Apache Directory]</span>\bin\php.ini'''
  
(e.g. C:\wamp\bin\apache\apache2.4.27\bin\php.ini)
+
(e.g. R:\wamp\bin\apache\apache2.4.27\bin\php.ini)
  
 
==Editing the php.ini configuration file==
 
==Editing the php.ini configuration file==
  
In the file php.ini, look for section '''[xdebug]''', and comment this line with a semicolon (;).
+
In the file php.ini, look for section '''[xdebug]''', and comment this line by adding a semicolon (;) at the beginning of the line.
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
Line 32: Line 32:
  
 
'''Save the file and restart all WampServer services''' (Apache, MySql, etc.)
 
'''Save the file and restart all WampServer services''' (Apache, MySql, etc.)
 +
 +
That's it!
  
 
==Alternate solution for developers==
 
==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 and set a maximum nesting level higher than the one displayed in the error message.
+
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.
  
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
Line 42: Line 44:
 
'''Save the file and restart all WampServer services''' (Apache, MySql, etc.)
 
'''Save the file and restart all WampServer services''' (Apache, MySql, etc.)
  
==Sample [xdebug] section after modification==
+
==Sample [xdebug] Section after changes==
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
[xdebug]
 
[xdebug]

Latest revision as of 19:54, 17 October 2017

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"


Wampserver-Maximum-function.jpg

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.

xdebug.max_nesting_level=500

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

Sample [xdebug] Section after changes

[xdebug]
; 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"
xdebug.show_local_vars=0
; This line is required to set the maximum nesting level when zend_extension is active
xdebug.max_nesting_level=500

IMPORTANT NOTE:

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.