Title: NGG interferes with error reporting during debugging
Last modified: September 24, 2018

---

# NGG interferes with error reporting during debugging

 *  Resolved [Rex V](https://wordpress.org/support/users/rextc/)
 * (@rextc)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/ngg-interferes-with-error-reporting-during-debugging/)
 * I’ve spent the last few hours trying to find out why a development WordPress 
   installation wouldn’t display bugs despite all PHP debug flags set to true. It
   turned out to be the NGG plugin; after disabling the plugin, PHP errors would
   display normally.
 * After lots of debugging we found that the NextGen plugin was altering the behavior
   of PHP error reporting. One important line is nggallery.php:169:
 * `set_exception_handler(__CLASS__.'::shutdown');`
 * This replaces the default exception handler **globally** with the NGG exception
   handler. This can be demonstrated by adding the following line to wp-settings.
   php:308:
 * `non_existent_function()`.
 * This shows a modified error report as opposed to calling the non-existent function
   a few lines earlier. I’ve determined this happens during loading of NGG..
 * After wp-settings.php:450 (do_action(‘init’)) errors do not display **at all**.
   I don’t know the exact reason for this, but the issue is resolved when disabling
   NextGen Gallery.
 * Why does NextGen Gallery decide to overwrite PHP exception handling? Why does
   NGG need to insert its own functionality in the error reporting? This affects
   a website globally.
 * We’re using the most recent version of WordPress (4.98) and NGG (3.0.8) with 
   PHP 7.0.26-2+ubuntu14.04.1+deb.sury.org+2.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Imagely](https://wordpress.org/support/users/imagely/)
 * (@imagely)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/ngg-interferes-with-error-reporting-during-debugging/#post-10719662)
 * We have already asked our developers.
    As soon as we hear back from them we’ll
   be writing you back.
 *  Plugin Contributor [Imagely](https://wordpress.org/support/users/imagely/)
 * (@imagely)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/ngg-interferes-with-error-reporting-during-debugging/#post-10722383)
 * We have created a “Bug Report” to be review by our developers.
    Please keep in
   mind that our developers need to address this issues in order of priority, so
   an issue that many hundreds of users are experiencing will need to be addressed
   before an issue reported that is affecting only a few users or just one. We’ll
   keep you posted.
 *  Thread Starter [Rex V](https://wordpress.org/support/users/rextc/)
 * (@rextc)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/ngg-interferes-with-error-reporting-during-debugging/#post-10722426)
 * Wow, thank you for the quick reply! For now we’ve asked developers to disable
   NGG on their local installations so it does not interfere with development. I
   hope this can be resolved soon, thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘NGG interferes with error reporting during debugging’ is closed to new
replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Rex V](https://wordpress.org/support/users/rextc/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/ngg-interferes-with-error-reporting-during-debugging/#post-10722426)
 * Status: resolved