WordPress

How to fix nearly any cause of internal server error with WordPress

The Internal Server Error is a common error that WordPress website owners sometimes encounter. This kind of error is not specific to WordPress, and it can be caused by a pretty wide variety of reasons.

One of the worst things about the internal server error is how generic it is–this type of error provides very little information as to what is causing the problem. That being said, internal server errors in WordPress are often caused by plugin and theme functions. Other possible causes of internal server errors in WordPress include a corrupted .htaccess file and exhausting PHP memory.

Here are some steps to troubleshoot, and ultimately resolve, internal server errors in WordPress.

Checking for a corrupt .htaccess file

The first thing you should do when troubleshooting the cause of an internal server error in WordPress is check for a corrupted .htaccess file. You can do this by renaming your .htaccess file (try something like .htaccess_old). To rename the .htaccess file, you will need to access your site using FTP (FileZilla is my favorite FTP client).

Once you have logged in to your site via FTP, your .htaccess file is located in the same directory of the wp-content, wp-admin, and wp-includes folders.

Once you have renamed the .htaccess file, reload your site to see if the issue is resolved. Before moving on, make sure that you go to Settings » Permalinks and click the save button. This will add the proper rewrite rules to your new .htaccess file to ensure that your post pages do not return 404 “not found” errors.

If creating a new .htaccess file does not work, keep reading.

Increasing the PHP memory limit

Sometimes this error can happen if you are exhausting your PHP memory limit. Use our tutorial on how to increase the PHP memory limit in WordPress to fix that.

If you are seeing the internal server error only when you try to log to your WordPress admin dashboard or while uploading an image in your wp-admin, then you should increase the memory limit by following these steps:

  1. Create a blank text file called php.ini
  2. Add this code to the file: memory=64MB
  3. Save the file
  4. Upload it into your /wp-admin/ folder using FTP

If increasing the memory limit successfully resolves the problem, then you have fixed the problem temporarily. However, you have now identified that there is something in your site or on your server that is exhausting available memory. This could be a poorly coded plugin or even a theme function. Ask your web hosting company to review your server logs to help you find the specific issue.

If increasing the PHP memory limit did not resolve the issue, you’re in for some advanced troubleshooting.

Deactivate all WordPress plugins

If none of the above solutions worked, the internal server error is most likely being caused by a specific plugin. If you recently installed a new plugin, and weren’t seeing errors before, that new plugin is probably to blame. It’s also quite possible that the mix of plugins you’re using on your WordPress site simply don’t play nicely with each other. Unfortunately, this will require some trial and error–systematically deactivating and activating individual plugins to identify the problem.

If you cannot access your WordPress admin dashboard, here’s our tutorial on deactivating all WordPress plugins at once using FTP or phpMyAdmin.

If disabling all plugins resolves the problem, you can narrow your remaining troubleshooting efforts to existing plugins. Systematically reactivate each plugin, one at a time, until you find the one that caused the errors. Delete the plugin, and report the errors you received to the plugin author.

Replace WordPress core files

If deactivating all WordPress plugins did not resolve the internal server error, then it’s a good idea to update both the wp-admin and wp-includes folders from a fresh WordPress install.

Have no fear: these folders only contain the WordPress content management system, so none of your themes, plugins, customization, or site content will be removed by replacing these files.

Download the latest version of WordPress here. Access your site via FTP and simply replace the wp-admin and wp-includes folders on your server with the newly downloaded versions.

Ask your web host for help

If none of the above steps worked, your next best option is to reach out to your web hosting provider and asking them to review your server logs. After this review, they should be able to identify what is causing the errors.

Contact Us