I've got a site that has a plugin that causes problems with the admin-ajax.php file to have 500 internal errors when its turned on. The plugin causes this issue in the ajax file even on pages of the admin that have no changes by the plugin.

Anyhow, first thing you normally try in such a situation is to enable the WP_DEBUG constant to get more details. Bizarrely the 500 errors don't then occur and the site works completely normally including the functionality of the problem plugin.

I'm not getting any help from the plugin developer so I'm on my own with this. Any ideas to get to the bottom of the 500 error as I'd really rather not leave the WP_DEBUG enabled.

  • What errors do you see when you have debug enabled? – s_ha_dum Oct 17 '15 at 15:50
  • I don't. The pages load normally. That's my point, its the opposite of what I was expecting. – AdamJones Oct 17 '15 at 15:58
  • Well, my guess is that you'd have to load admin-ajax.php to see the errors, or log to a file. Are you doing either of those? – s_ha_dum Oct 17 '15 at 16:01
  • I've loaded the ajax admin file directly and yes it produces 500 errors but I can't see any specific errors for the 500 issue in the apache log or the php log which ive set to output to file. Maybe I've not got the correct parameters set and maybe out of scope of WP here but thats where im stuck – AdamJones Oct 17 '15 at 21:26

There are two aspects to WP_DEBUG:

  1. It configures PHP runtime to desired state, this is handled once in wp_debug_mode().
  2. It is used as a state flag, that can be arbitrarily checked by code. Widely done both in core and more so in third party code.

It is hard to make a guess how either of these can lead specific install in (or out) of error 500. Your main issue is mostly lack of information of what precisely that error is, not its interaction with debug mode.

I would shake your hosting support (or other appropriate party) to provide more information about error 500. That might require more serious access to server and maybe even reconfiguring Apache. Out of WordPress land.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.