If you want to easily fix WordPress 500 internal server error, then you’ll love this detailed guide.
You shouldn’t panic when you see the internal server error on your WordPress site.
Even though this error doesn’t tell you what’s wrong, you can easily fix this error with the solutions in this post.
Before trying these solutions, we highly recommend backing up your WordPress site just to be on the safe side should anything go wrong.
Keeping backups is of great importance, and it’s a good habit to form. By the way, if you experience the 500 internal server error after making recent changes to your site, you can simply restore a backup you created prior to the changes.
That aside, let’s get started.
Causes of 500 Internal Server Error in WordPress
The WordPress 500 internal server error in WordPress can be caused by a number of issues such as:
- Corrupted .htaccess file
- PHP memory limit issues
- Problematic plugin(s)
- Corrupted WordPress core files
Now, let’s go over these causes one by one and outline a solution for each.
Corrupted .htaccess File
More often than not, a corrupted .htaccess file throws the internal server error in your face.
.htaccess (short for Hypertext Access) is a configuration file used by your web server to control the directory it lives in (in this case your WordPress directory) and all sub-directories under that directory.
To determine if a corrupted .htaccess file is the cause of the WordPress 500 internal server error on your site, we begin the diagnosis by renaming your existing .htaccess file.
Login to your WordPress directory (the folder where your site lives) using FTP. You’ll know you are in the right directory if you see sub-folders such as wp-content, wp-includes and wp-admin:
In most hosting environments, your WordPress directory site is usually the Home or Public_html directory. If you installed WordPress on a sub-domain such as yoursite.com/someurl, your WordPress directory is someurl.
Next, locate your .htaccess file and right-click on it. Next, choose Rename. Rename your .htaccess file to something like .htaccess_old:
After renaming your .htaccess file, reload your site to see if this solution fixes the 500 internal server error. If you can no longer see the internal server error, you can pop the bubbly.
Recreating .htaccess File
Next, login to your WordPress admin dashboard, navigate to Settings -> Permalinks and click the Save button at the bottom of the screen:
Saving your permalinks creates a new .htaccess file for you automatically.
If the error persists, read on to discover more solutions.
PHP Memory Limit Issues
At times, you could be getting the 500 internal server error in WordPress because you are exhausting your PHP memory limit. Fixing PHP memory limit issues is as easy as pie.
Increasing your PHP memory limit can also fix the memory exhausted error, which is as baffling as the internal server error.
Increasing PHP Memory Limit for WordPress
You can increase your PHP memory limit by editing your wp-config.php file that is inside your WordPress directory (the same directory where the .htaccess file lives).
- Login to your WordPress directory and download wp-config.php file to your computer:
- Open the wp-config.php using a code editor such as NotePad++ or Atom and add the following code just above the line that says
/* That's all, stop editing! Happy blogging. */:
define ('WP_MEMORY_LIMIT', '300M');
This code instructs WordPress to increase the PHP memory limit to 300 MB.
- Next, save the changes and upload wp-config.php to your WordPress directory:Don’t hesitate to overwrite the existing wp-config.php file:
Internal Server Error When Accessing Admin Area
As long as we’re talking about memory limits, it’s important to point out that you could see the 500 internal server error only when you try to upload an image or login to your WordPress admin area.
If this is the case, you can increase the memory limit by following these steps:
- Using preferred text editor, create a new file and add this code in there: memory=64MB
- Save the file as php.ini. Ensure you get the extension (.ini) right by choosing All types in the Save as type field:
- Upload this file to the wp-admin sub-folder within your WordPress directory using FTP.
Fixing PHP memory limit using the php.ini file only works for localhost installations or/and WordPress VPS hosting. Use the wp-config.php file method above if you have 000webhost’s free WordPress hosting.
Increasing your PHP memory limit might fix the WordPress 500 internal server error, but it’s just a temporary fix since it means something on your site is eating up your server resources. For a complete diagnosis, you might need to dig into your error logs.
But even if increasing PHP memory limits doesn’t fix this error, it is time to check whether the problem lies in your plugins.
The WordPress 500 internal server error can be the result of a faulty plugin or two conflicting plugins. To tell if a plugin is the root of the error, you need to deactivate all of them first.
Login to the WordPress directory. Open the wp-content folder and locate the plugins folder:
Rename the folder to something like plugins_old to deactivate all plugins at once. Don’t worry, you won’t break your site or lose any plugin.
Reload your site to see if this solution fixes the internal server error. If so, it’s time to eliminate the problematic plugin.
Rename plugins_old back to plugins and login to your WordPress admin dashboard. Next, activate your plugins one by one while refreshing your site each time until the error reappears.
If you re-activate a plugin and the internal server error reappears, it means the last plugin is the culprit. Just delete the responsible plugin via FTP and notify the developer of the error.
Corrupted WordPress Core
Now if all the other solutions fail, perhaps the 500 internal server error in WordPress is caused by corrupted WordPress core files.
While this is rarely the case, things break all the time. To repair your WordPress core files, you must upload fresh versions of wp-admin and wp-includes folders.
- Head over to WordPress.org and download a fresh version of WordPress:
- Extract files from the WordPress .ZIP archive.
- Inside the WordPress folder locate the wp-admin and wp-includes folders:
- Login to your WordPress directory via FTP and upload the new wp-admin and wp-includes folders overwriting the older versions:
Refresh your site to see if this fixes the error. Wait – did you just say you’re still seeing the 500 internal server error?
Well, you can use WordPress built-in debugging tool feature to figure out what’s causing this error.
Enabling WordPress debugging mode allows you to write all errors to a file called debug.log that is stored inside the wp-content folder.
To enable debugging:
- Login to your WordPress directory via FTP and download the wp-config.php file
- Open wp-config.php file and add the following code just before the line that says
/* That's it, stop editing! Happy blogging */:
define ('WP_DEBUG', true); define ('WP_DEBUG_LOG', true); define ('WP_DEBUG_DISPLAY'. false); @ini_set ('display_errors', 0);
- Save your changes and upload wp-config.php to your WordPress directory overwriting the older version
Now, reload your site to trigger the error. Open your WordPress directory, navigate to the wp-content folder and open debug.log. If you have a developer friend, they can help you to decipher the errors.
We can also lend a hand whenever you’re stuck, so don’t hesitate asking your questions in the comment section.
The WordPress 500 internal server error is mainly the result of a bad .htaccess file or exhausting your PHP memory limit. All the same, fixing this error is as simple as A, B, C, which means you needn’t panic whenever you encounter this error.
Did any of the above solutions fix the 500 internal server error for you? If so, please let us know in the comment section.
Have you ever seen the 500 internal server error in the past? How did you fix it? Please share your fix with us in the comment section below.