Debugging PHP, WordPress, And .htaccess Errors (5XX)

Table of Contents

PHP #

If your website is giving 500 errors, one frequent reason is errors in your PHP code. To see what's happening, you can add the following lines to the beginning of your code.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

This will display all errors when you reload and access the page. "Errors" or "Fatal Errors" are the things you should worry about. Warnings and other messages can be ignored.

WordPress #

If you use WordPress and receive a "critical error" message, you can enable WP Debug mode to check for any error also.

To do this, add the following line to your wp-config.php file via FTP or the panel's file manager:

define("WP_DEBUG", true);

Then go to the page where you get errors and reload it to see what comes up. Like PHP, warnings, info, and depreciation messages can be ignored.

Not fixed? #

If this does not fix the 500 errors, it may be a problem with your .htaccess file or server.

To see if it's .htaccess, rename the files to htaccess-backup and see if the site works.

You can also check for serverwide issues on our status page here: https://status.cynderhost.com

If you find an error you are unsure about or don't know what's happening, feel free to contact our support team and we will assist you as best as possible. Keep in mind, there are many, many frameworks out there and our team might not be knowledgeable in all of them as they are third-party developers frameworks. In these cases, we may recommend you to contact the author or a specialize developer.