The 500 Internal Server Error is one of the most common WordPress errors. This article will show what steps to take to identify the cause of the error. In addition, we will provide an in-depth analysis of the most effective solutions.
By reading this tutorial, you will learn how to Fix the 500 Internal Server Error in WordPress.
- FTP Client (such as FileZilla, CyberDuck, etc.)
- Text Editor (such as Notepad++, Atom, etc.)
What is a 500 Internal Server Error?
The 500 Internal Server Error indicates that the server is unable to perform a particular function. It can be due to an issue on the server itself or a problem with a file crucial for running a website. The error message is vague and is supposed to imply that an unexpected error occurred.
Backup Your WordPress Site
Backing up your website when planning to troubleshoot the 500 Internal Server Error is always a good idea. It will be necessary to turn off certain functionalities of your website management system to determine which element is triggering the error.
The most common backup methods are:
- Installing WordPress plugins that allow you to create backups
- Using your Host interface to create a backup
- Create a backup for WordPress site using FTP & phpMyAdmin
Note: Before attempting to troubleshoot the 500 Internal Server Error check if a caching plugin is active (like WP Supercache or another similar plugin). You may not see your fix “work” until the cache has been rebuilt. If possible, turn off the caching plugin before attempting the fixes mentioned or allow a brief period between changes for the cache to rebuild.
Use an FTP Client to Fix WordPress 500 Error
FTP clients are widely used as they provide access to files and folders of a website. The interface is user-friendly and very much in tune with a standard file explorer. This environment will allow you to easily upload, download, and manage files on your server. FileZilla is used in this example; however, any FTP client will work.
Once you log in to your FTP client, locate your WordPress site core files. Open the public_html folder:
You are now in an excellent position to troubleshoot the most common issues that cause the 500 Internal Server Error:
- Corrupted .htaccess File
- PHP Memory Limit Issues
- Audit Problematic Plugin(s)
- Corrupted WordPress Core File
How to Fix a Corrupted WordPress .htaccess File
The .htaccess file is used to configure website access rules. Updates and changes to server settings are frequent. These actions result in files getting altered or corrupted from time to time. To establish if your .htaccess file is corrupt, rename it using the FTP client.
If it is corrupt, merely replacing it with a new .htaccess file will solve the 500 Internal Server Error.
Check for Corrupt .htaccess File
To determine if the .htaccess file is corrupted we will rename it to .htaccess_old. This simple action will disable the functions of the .htaccess file altogether.
Refresh your website. If it is accessible, it means that you have discovered the cause of the 500 Internal Server Error.
Create a New .htaccess File
To create a new .htaccess file in WordPress:
- Navigate to your WordPress Admin dashboard.
- Go to Settings > Permalinks.
- Click Save Changes.
Saving your settings will automatically generate a new .htaccess file in your public_html folder. By using the FTP client, you will be able to see the new .htaccess file.
Additionally, you can delete the old .htaccess file – the same one you renamed earlier.
Note: Always check if file permissions are correct. Incorrect permissions will prevent your WordPress site from working correctly. The permissions on the .htaccess file should be 0644.
How to Increase the PHP Memory Limit in WordPress
If you are still getting the 500 Internal Server Error, you might have exhausted your PHP memory limit. You need to increase your PHP memory limit to determine if you are having an issue with a lack of memory.
Increase PHP Memory Limit in wp-config.php File
If your WordPress Admin is accessible, and the issue is with your website solely, you need to edit the wp-config.php file.
- Locate the wp-config.php file in the root folder of your website.
- Right click on the wp-config.php file and select Download from the menu.
- Open the file with Notepad++ or any other text editor.
- Locate the /* That’s all, stop editing! Happy blogging. */ line. Just above it type:
define ('WP_MEMORY_LIMIT', '64M');
- Save the file.
- Upload the edited wp-config.php file by overwriting the existing one in your root folder.
Increase PHP Memory Limit in php.ini File
A lack of memory can even prevent you from accessing your WordPress Admin altogether. You can resolve the issue by adding a php.ini file to the wp-admin folder:
- Open a text editor (Notepad++ in this example)
- Save file as php.ini
- Upload the file to the wp-admin folder using your FTP client
If this solved the immediate 500 Internal Server Error, excellent. However, this proves that the error is only a symptom. It means that something is rapidly draining your server’s resources.
Analyze your logs in detail and have your hosting company investigate as well.
Audit WordPress Plugins
Another option is that the 500 Internal Server Error is caused by one of your WordPress plugins. Rather than testing each plugin piecemeal, there is a simple way of determining if a plugin is at fault in the first place.
The plugins folder is located within the wp-content folder.
1. Rename the entire plugins folder using your FTP client. It will deactivate all your plugins at once. Renaming the folder will not edit nor delete the plugins themselves.
2. If you can access your website at this point, you have determined that one of the plugins is at fault. Rename the folder back to plugins.
3. Access your WordPress admin and activate each plugin, in turn. This action will allow you to pinpoint which plugin is causing the 500 Internal Server Error.
4. The error will return the moment the failing plugin is turned back on. Make sure that you refresh your page after every change you make.
By following the steps outlined above, you should have successfully located and disabled the plugin responsible for the error.
Reinstall Corrupted Core WordPress Files
Alternatively, there might be an issue with your WordPress core files. It is a fast and easy fix. We need to replace two folders in your WordPress core using the FTP client:
- Go to WordPress.org and download the latest version of WordPress.
- Unzip and open the downloaded archive and copy the wp-admin and wp-includes folders.
- Replace the identically named folders on your server with the freshly downloaded ones.
- Reload your website.
If none of the options worked, a slightly more complex solution might be in order. You can use the WordPress debugging tool to gather more information about the error.
Again, by using an FTP client and a text editor of your choice, enter the following code into the wp-config.php file:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true );
Every time WordPress encounters a warning, error, or generates a notice, it will be written to your log with a timestamp.
You will find the info in the debug.log file.
The log contains a lot of information. It might be challenging to interpret the data unless you have extensive technical skills. If you have doubts, ask for professional advice before taking any measures based on the gathered data.
This article provides the best course of action to fix the 500 Internal Server Error in WordPress.
You now have a better understanding of how WordPress works. As a result, you will feel much more confident when encountering similar challenges in the future.