Can you solve the problem, when you do not know the problem? Of course, it is not possible. To solve the problem, you must know the source of the problem.
Server errors give similar panic attacks, to webmasters. They leave them groping in dark, with no clues in hand.
The problem that haunts the WordPress webmasters the most is 500 internal server error. The website simply fails to load and no clear source is visible.
This vagueness makes 500 internal server errors one of the most dreadful troubles. You have zero additional information. It is practically impossible to resolve it without lots of time and patience.
If you have an e-commerce website, you cannot even afford the smallest downtime. It is critical to fix the problem in the minimum time span.
Luckily, that is what we are going to tell you in this post. We will briefly explain how to resolve 500 internal server error in WordPress.
What is 500 Internal Server Error?
When you visit the website, the browser sends a request to the server, where the host is located. The server sends back the requested resources, which include PHP, CSS, and HTML, which also includes the HTTP status code.
This code’s purpose is to notify about the status of the request. 200 means everything is fine and 500 means something is fishy.
500 internal server error indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
Variations of Error 500
500 internal server errors can manifest themselves in a number of different ways. It is because of various web servers, operating systems, and browsers. The essence of all of them is exactly the same.
Here are just a couple of the many different variations you might see on the web.
- 500 Internal Server Error
- HTTP 500
- Internal Server Error
- HTTP 500 – Internal Server Error
- 500 Error
- HTTP Error 500
- 500 – Internal Server Error
- 500 Internal Server Error. Sorry, something went wrong.
- 500, that is an error. There was an error. Please try again later. That is all we know.
- The website cannot display the page – HTTP 500
- Is currently unable to handle this request. HTTP ERROR 500
You may encounter this message, sometimes.
“The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, email@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.”
In WordPress, it normally happens because a script that is part of a theme or a plugin did something it should not have done. Eventually, your server crashes.
Always try to use W3c Valid WordPress Themes.
How to Fix 500 Internal Server Error?
So where to start troubleshooting? You normally have no idea, where to begin.
Let us address the common causes and ways to fix this error.
Try to Reload the Page
However, it is obvious, but this is the first thing you should try. May be your host or server is overloaded. If it does not help, paste the link of your site here. It will tell your site is down or the problem is at your side.
Clear The Cache of Your Browser
This is another good option. Do it before you start deep troubleshooting.
However, remember that there is no single technique for all browsers. Instructions are different depending on you have, either Google Chrome, Mozilla Firefox, Safari, Internet Explorer or Microsoft Edge.
A simple google search would show you all these techniques, separately.
Turn on Debugging
This may give you an insight into what is happening. To turn on debugging, you have to edit the wp-config.php file.
Open this file and locate WP_DEBUG within. You must be able to set it to true. It should look like this, in the end.
// Enable WP_DEBUG mode define( 'WP_DEBUG', true ); // Enable Debug logging to the /wp-content/debug.log file define( 'WP_DEBUG_LOG', true ); // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( 'SCRIPT_DEBUG', true );
Save it and reload your site. It would be okay now if you were lucky. It is also possible that you encounter a different error.
If this happens, locate the error. If you find it in any plugin folder, disable that plugin.
Even if turning the debugging on does not give the desired result, keep it on until the problem is resolved.
Plugins and Themes
Deactivate all your plugins if you have access to the dashboard. If the problem solves, this means some of your plugins are misbehaving. Switch them on, one by one to figure out which one it is.
This is also very likely that the issue is caused by some WordPress theme. Always make sure that you install W3c Valid WordPress Themes.
You may also switch your theme to the default and un-altered WordPress themes like Twenty Fifteen or Twenty Sixteen. Does the site now load without internal server error?
Inspect your .htaccess file
This file contains the number of rules that tell the server what to do in which circumstances. Commonly, it is used for rewriting URLs to or preventing access to your site for malicious intent.
Open your FTP editor to check if you have .htaccess file in your WordPress root folder. Make sure it displays hidden files, too.
If you find the file, there make its backup instantly. Then delete all the content within or deleted the file at all.
Check if the website loads now.
The PHP Memory Limit
Exhausting the PHP memory limit on the server can also be the culprit. Try to increase this limit.
Open the FTP client, and find a wp-config.php file. Right-click and select view/edit. Choose the default editor.
You will find the desired line under the WP_DEBUG line. You can add if it is not there. It should look like this in the end.
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); define( 'WP_MEMORY_LIMIT', '256M' );
whole that modifying your wp-config.php file doesn’t fix the problem, you’ll have to address the issue within your server settings . The php.ini file is the default PHP configuration file. Most of the Shared Hosting does not allow access the php.ini file.To increase the PHP memory limit , change these lines in PHP.ini
memory_limit = 256M upload_max_size = 64M post_max_size = 64M upload_max_filesize = 64M max_execution_time = 300 max_input_time = 1000
In the event, you don’t have access to your php.ini file, then your last resource is to modify .htaccess file. the .htaccess file starts with a dot because it is a hidden file. If you can’t root folder, check to make sure that your SFTP file manager isn’t begin those files hidden from view.
In your .htaccess you can add:
php_value memory_limit 64M
php_value memory_limit 64M
Refresh both your FTP client and website. What happens now? PHP memory limit was definitely the issue if everything is ok now.
Try to figure out later, that what is draining the memory. Any poorly hosting, coded plugin or theme can be the issue. The best way to figure out is to contact your hosting provider. Ask them to check the server logs.
Check File Permissions
In your WordPress directory, files should be set to 755 or 644. If they are not, you could end up with a 500 error on your website. To check this out, log in to your FTP client and look in your site’s directory under Permissions.
You will notice that all folders are set to 755 and everything else on 644. If any of the things are set to something else, change it instantly. Enter the right number.
Coding or Syntax Errors
The errors in CGI and Perl script is also one of the most common reasons. Here are some things you should do when working with CGI scripts.
- Always use a plain text editor for editing. You may opt Atom, Sublime or Notepad++. This way they remain in ASCII format.
- Make sure that correct permissions of chmod 755 are used on CGI scripts and directories.
- Always upload your CGI scripts in ASCII mode, into the cgi-bin directory on your server. You can select it in your FTP editor.
- Assure that the Perl modules you require for your script are installed and supported.
Contact With Your Host
When nothing seems to work, it is because any uncommon issue has created the problem. This is the point where you should contact your host.
There may be any genuine or severe server issue only they can confirm and fix.
You may switch to the better host whose servers are more optimized to run WordPress sites.
In some scenarios, this tip also works. Reinstalling the WordPress core would remove the corrupt files that cause server error. There are different ways to reinstall WordPress. Surf the internet to find out the best one.
Yes, 500 internal server errors are horrible. Third-party plugins, fatal PHP errors or database connection issues are the most common reasons.
Now you know a few additional ways to troubleshoot and quickly get your website back.
We really hope that any of these tips fix out your problem. We tried to make this text simple and easy enough for beginners. Our intention is to help them when an issue pops up and takes your website down.