11 best ways to fix WordPress internal server error
WordPress is not any special case when it comes to errors. So, how can you get your site back in such a situation? Every second, even minute- you are losing your sales and traffic.
The internal server error is not just distinguished to WordPress. It can happen on any server. Since the nature of this error is generic, it will not tell you anything.
The second main cause of internal server error can be corrupted .wp-config or .htaccess files. Last but not least, the memory limit of PHP.
There also may be cases where an internal server error may show up when you access the Dashboard.
Before we check the ways to fix WordPress internal server errors, let us understand what it is.
What is a WordPress internal server error?
WordPress internal server error is an annoyance to developers and users alike. Let us understand this easily. It does not give the details regarding the root of the problem.
Let us understand this more simply. Suppose you are uncomfortable with pain and went to the doctor. But you are not ready to share the area where the pain is. It will be quite hard for the doctor to give you proper medication and treat it. Similar is the case with the internal server error. There will be no indication about the source of the problem.
WordPress internal server error can at times be misleading. You need to do trials and troubleshooting to find the error source. Here we will be discussing 500 internal errors.
What is a 500 internal error?
Internet Engineering Task Force explains the 500 internal server errors as the status code. It is an indication that the server has encountered an unanticipated condition. It has stopped fulfilling the request.
The code will give you the status of the request. Now if you see 200, you need not worry. But if it is 500, then something is really wrong.
There are different types of 500-level status codes. They are 501, 502, 503,….likewise. 500 WordPress internal server errors can impact negatively on your SEO rank. Hence, it is for sure that you want to avoid 500 WordPress internal server errors.
This may also hurt your UX and will give an impression to your users that you are not professional. You will ultimately be losing your potential clients.
Let us see some other potential causes of 500 WordPress internal server errors:-
- Syntax or coding errors
- Issues in Plugin compatibility
- Corrupted files
- The exhausted memory limit of PHP
Variations on 500 WordPress internal server error
Now it depends upon the browser, operating system, etc. There are variations of how 500 WordPress internal server error appears. If the database connection is not established, you will see it like in the image below:-
White Screen of Death also indicates 500 WordPress internal server errors.
There are many business owners who customize 500 server error messages. Hence, you will see these types of messages in different forms.
10 best ways to fix WordPress internal server error
1. Backup your site
Make a backup of the website first. You can either go for manual backups.
You must always do the complete backup. For this, you need to save copies of the database as well as WordPress files. You can utilize SFTP for the back up your website’s files.
Connect to the server and navigate for the WordPress files. These files will enclose WordPress plugins, images, core installation, themes, etc. You need to right-click on these options and save the files. Next, choose “Download”.
To make the backup of the database, you must first sign into phpMyAdmin. You must figure out the files which you have plans to download. Next, tap on the tab “Export”.
Here, you must pick between a “Custom” or “Quick” export.
The second option, Quick export will not work properly unless you do not manage advanced options.
Tap the button “Go” for download. Now, since you have safely backed up your website, you can work on fixing the WordPress internal server error.
2. Rename the existing .htaccess file
You must rename your .htaccess file. For this:-
- Use the File Manager tool of cPanel
- Connect your website using FTP
Here, we are going to use the process using File Manager. The best way to fix WordPress internal server errors.
Visit the dashboard of cPanel and access File Manager.
Open this file and figure the .htaccess file. Right-click on the option and click “Rename”.
Rename this file and develop a new .htaccess file to replace it.
3. Try to reload the page
There are some situations wherein WordPress internal server error will clear on its own. Now, if you have made changes to a theme/ plugin or if the host experiences heavy traffic, you will see a server error.
Press the key “F5”. If you are using a Mac, tap command + R.
4. Clear the caches of your browser
The cache may get corrupted. This will cause hindrance while accessing the site.
If you are seeing “Access your website from a different browser” message then the issue is with the cache.
To clear the cache, go to “Google Chrome”. Click “Ctrl + Shift + Delete”. If this is not working for you, click the right three vertical dots on Google Chrome. Then tap “More tools” and go for the option “Clear browsing data”.
Ensure to check the files box and Cached images. Then tap the button “Clear data”.
If you are using Firefox, click “Ctrl + Shift + Delete” to clear the cache. It will open a new window that shows the “Clear Recent History”.
Click the drop-down and choose “Everything” under the “Time range to clear”.
Ensure to check the box of “Cache”. Tap the option “OK”.
For Safari, navigate to the menu item of History. Click “Clear History”.
Once you clear the cache of the browser, you can make an attempt to access your site again.
5. Access the error logs
The website’s error logs give insight into the source of 500 errors. It will depend upon your host. Hence, you must always take a quick look swiftly.
One can access the website’s file using SFTP and check for the /logs directory. You need to choose the website where it is experiencing the error. You will come across numerous directories here. Go for the most recent date.
With a text editor, you can check these logs. Download it!!
Here you will find some context related to 500 errors.
You can even try an alternate option, i.e to enable the debug log of WordPress. Next, connect your website through SFTP. Open the wp-config.php file.
Look for the line “define(‘WP_DEBUG’, false);”. When you find this, replace this with
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
define( ‘WP_DEBUG_LOG’, true );
It will build a debug.log file. This you will see under /wp-content/ directory. Change the value back to “False” when done with troubleshooting.
6. Look for ‘Error Establishing a Database Connection.’
If you are experiencing trouble establishing the database connection, your website will be offline to your visitors. Moreover, you cannot access the admin dashboard of WordPress. Let’s check for some possibilities:
- Incorrect credentials for database login
- A corrupt database of WordPress
- A corrupt installation file of WordPress
An incorrect login credential can cause a database connection error. For this, you need to browse through MySQL Databases. This you will find under the server section with Database as the heading.
Under the column of Users Access, you will see the username that is listed.
Click on the username to figure out the password.
Navigate and tap the button “Show”. This will be next to the field of password.
You need to compare wp-config.php files with these credentials. One can access the file in the main directory of the website through SFTP.
Download the file. Next, you need to do the verification of the information under MySQL Settings. Ensure that it matches with that of your panel.
Next, you can quickly repair a corrupted database via phpMyAdmin. For this, log in and look for the database, tap it.
Ensure to choose all the tables that you see here and click the option “Repair” This you will find in the drop-down menu.
Lastly, let us try to fix the installation file of corrupted WordPress. Download the file and unzip it. Make sure to delete the wp-config-sample.php and wp-content folder.
Through SFTP, try uploading the rest of your files to the website. You can overwrite the existing ones. You will have a new file with uncorrupted WordPress installation. Make sure to clear the cache of your browser before making the next move.
7. Check for the permission errors
Now, if you have any files with incorrect permissions, you will see 500 internal server errors. Here, you can again use SFTP to change the permissions.
Make sure to right-click on any file and choose “File permissions”. You will see a new dialogue window. Here, if required you can set new permissions for your files.
You need to set your files to directories and “644”. Next, you need to set the executables to “755”.
8. Increase the memory limit of PHP
This is another reason for 500 internal server errors. You can expand your limit. But again you need to involve using SFTP.
Make sure to check what you are currently set to before expanding your PHP memory limit. For this, you need to access the admin dashboard of WordPress.
You cannot access the dashboard if there are some variations in 500 internal server errors.
On the WordPress dashboard browse for “Tools” and click “Site Health”. Tap on “Info” and navigate to the section of “Server”. You will see the memory limit of your PHP here.
You need to edit a few files to expand the PHP memory limit.
You can also edit the php.ini file to expand the memory limit. You can check for this file under the root directory. If you did not find it, not, create one. You can update or add the following code:-
memory_limit = xxxM
Another alternate option is to add the code at the top of the wp-config.php file.
If it resolves 500 errors, your next task is to find the culprit behind the memory limit exhaustion. This can be any problematic theme or plugin.
9. Check the .htaccess file for problems
The .htaccess file is an important file of WordPress. This has all the rules for It your server. It could be one of the problems for a 500 internal server error.
Suppose, your .htaccess file becomes corrupted. You need to create a new file. For this login to your website using SFTP. Search for the .htaccess file. Make sure to rename it to.htaccess_old.
Develop new .htaccess file in the text editor. Paste as shown in the image below:-
Next, upload the newly developed .htaccess file. Make sure to refresh your website in your browser.
10. Look for syntax or coding errors in the CGI/Perl script.
You may see 500 internal server errors when you run (CGI) scripts. To check this, log in to CGI scripts using SSH.
You can troubleshoot the CGI using the following command
The terminal will return the line number and general message where the culprit is located. Here, you need to showcase your talent in coding.
There are a few practices that you must follow when you work with CGI. Make sure to employ a plain text editor for the maintenance of ASCII format. Choose ASCII mode onto the FTP client when you upload your scripts.
Next, you need to upload this on cgi-bin directory. Double-check the permissions of your files once you upload them.
11. Ask the web host regarding the risks of potential server issues
If nothing worked for you, then it might be a server issue. Only your host can give confirmation.
Mostly, if the server of the host experiences trouble, then you need to wait some time for website downtime.
Let us take the lead!!
Yes, it is true it won’t be a good experience when fixing 500 internal servers. You need to be a little patient. A good WordPress development company like WP Customer Service can assist you to get your website back on track quickly.
You can take baby steps such as clearing the cache of your browser, refreshing the page, etc.
If you cannot fix this, on your own, we being the leading WordPress development company is just a click away.