How to get the real error message of 500 error in WordPress (for debugging)?

Sometimes you will encounter the 500 error when use a feature of theme or a plugin. To identify which causes the error, please follow 3 steps below:

1. Open file wp-config.php in the root folder of your website (you will need to login to Cpanel >> File Manager tool, or login to file server with FTP client software), then replace this line:
define( 'WP_DEBUG', false );
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);

Then save the file.

2. Reuse the feature which causes problem (to catch the error).

3. Open the file debug.log inside the /wp-content folder. You will see the detail error message, which will help to identify and resolve the problem.

Best regards,