how to debug 500 internal server errors
Posted by: SRD (---.lns1.way.bigpond.net.au)
Date: November 30, 2016 08:03AM

I've started developing a plugin. On activating it in the dashboard, the dashboard and front end produce a 500 internal server error.

Moving the plugin folder from `/wp-content/plugins` to `/wp-content/plugins.temp` resolves the error.

I'd like more information on how the plugin is producing the error. In `wp-config.php`, I have:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
define('SCRIPT_DEBUG', true );

My problems are:

- `debug.log` is not being produced at all (inside `/wp-content`/)
- The front and back end are not generating any debug info in the web browser.
- The WampServer Apache error log contains nothing about the local site (a vhost: `www.test.dev`) I am developing on

I tried editing vhosts.conf to include the line:

ErrorLog logs\test-dev.log

This file was not produced by Wamp Apache. I created it, reloaded front and back end, but the file logs\test-dev.log was blank.

**What other steps can I take to gain debug info?**

Options: ReplyQuote
Re: how to debug 500 internal server errors
Posted by: RiggsFolly (Moderator)
Date: November 30, 2016 10:00AM

Hi

Error 500 are notoriously difficult to debug as they indicatae a catastrphic error. You normally get very little help from any of the logs.

They are in 99% of cases due to PHP code you have written.

My approach is normally to

1. comment out all the code in the offending script
2. Make sure the code run in this state
3. Uncomment a few lines at a time until the 500 error happens again
4. Once you get here, you know which fre lines the error exists in and you can wittle it down to the few or hopefully one line that is causing the issue.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.