Author: gauravkuthari

  • How to Fix the WordPress 500 Internal Server Error

    You open your site and see “500 Internal Server Error” (or a blank white page). It is stressful, but it is almost always fixable, and usually the cause is one of a handful of things. Here is the order I check them in when a WordPress site goes down.

    1. Take a backup before touching anything

    If you can still reach your hosting control panel (cPanel or similar), take a quick backup of the site files and database first. Every fix below is low risk, but a backup means you can always undo what you tried.

    2. Read the error log

    A 500 error is only a generic message: something went wrong on the server. The real reason is in the logs. In cPanel, open Errors or the error_log file in your site folder. You can also turn on WordPress debug logging by adding these lines to wp-config.php:

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

    Reload the broken page, then open wp-content/debug.log. The last few lines usually name the exact plugin, theme or file that failed. Remember to switch debugging off again afterwards.

    3. Suspect a plugin or theme conflict

    The most common cause by far is a plugin or theme update that does not agree with your PHP version or with another plugin. If the log points to a plugin, or if the problem started right after an update, rename that plugin’s folder inside wp-content/plugins (for example, add -off to the end). WordPress will then deactivate it. If the site comes back, you have found the culprit. To test every plugin at once, rename the whole plugins folder, then restore it and re-enable plugins one at a time.

    The same trick works for themes: switch to a default theme such as Twenty Twenty-Five by renaming your active theme’s folder.

    4. Check the .htaccess file

    A corrupted .htaccess file causes many 500 errors, especially after a plugin changes redirect or caching rules. Rename it to .htaccess-old and reload the site. If it works, go to Settings, then Permalinks in WordPress and click Save to generate a clean new one.

    5. Look at PHP version and memory

    Two more common causes: running a plugin built for a newer PHP version than your server has (or an old plugin on a newer PHP), and hitting the PHP memory limit. In your hosting panel, check the selected PHP version and try the one just above or below it. If the log says “Allowed memory size exhausted”, raise the limit by adding define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php.

    6. Other things worth checking

    • Corrupted core files: re-upload a fresh copy of the wp-admin and wp-includes folders from wordpress.org.
    • Database problems: check the credentials in wp-config.php, and use the built-in repair tool by adding define( 'WP_ALLOW_REPAIR', true ); if tables are damaged.
    • File permissions: folders should normally be 755 and files 644.
    • Hosting limits: a full disk or an exceeded resource quota can also trigger errors, so ask your host.

    When to ask for help

    If you have followed these steps and the site is still down, or you are not comfortable editing server files, stop and get help rather than guessing. Random changes on a live site can turn a simple fix into a bigger one.

    That is exactly what I do. Send me the error message or a link to the broken page, and I will tell you what I think is wrong, at no cost. Contact me here and I usually reply within a few hours.