How To Fix The HTTP Error 500 On Your WordPress Website
When there is a problem with the server or file system that powers your site, the 500 internal server error appears on every page. The reason is most likely in the root directory, which contains your WordPress files. However, it could also be affected by a problem on the server of your host.
This is one of the most distressing WordPress errors. It never has a simple solution. Because it requires comprehensive troubleshooting which can take your time and patience. But ArrowTheme will help to address HTTP Error 500 WordPress by suggesting a few solutions to this problem and walking you through each one. Are you ready to start right now?
Before coming to the HTTP Error 500 WordPress, we will go through the definition of a 500 Internal Server Error.
What is a 500 Internal Server Error?
According to the Internet Engineering Task Force (IETF), The 500 Internal Server Error is as follows:
The status code 500 (Internal Server Error) means that the server found an unexpected condition that prevented it from completing the request.
When you go to a website, your browser will send a request to the server that hosts the site. This request is processed by the server. Besides that, the requested resources (PHP, HTML, CSS, etc.) are returned along with an HTTP header. The HTTP also includes an HTTP status code.
Therefore, a status code is a method of informing you of the status of a request. It could be a 200 status code. It indicates that “everything is fine”. Moreover, a 500 status code indicates that something has gone wrong.
There are numerous 500 status error codes such as 500, 501, 502, 503, 504,… However, they have something different. A 500 internal server error, in this case, shows that the server faced an unexpected situation that prevented it from fulfilling the request (RFC 7231, section 6.6.1).
500 Internal Server Error Variations
A 500 internal server error can appear in a variety of ways due to the various web servers, operating systems, and browsers. Here are just a few of the many variations you might come across 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’s an error. There was an error. Please try again later. That’s all we know.”
- “The website cannot display the page – HTTP 500.”
- “Is currently unable to handle this request. HTTP ERROR 500.”
Sometimes, you may only see a blank white screen. When dealing with 500 internal server errors, browsers such as Firefox and Safari are quite common.
Furthermore, larger companies, such as Airbnb, may have their own custom 500 internal server error messages.
Even YouTube isn’t immune to 500 internal server errors.
If the server is running IIS 7.0 (Windows) or higher, there are additional HTTP status codes that show the source of the HTTP Error 500 WordPress:
- 500.0: An ISAPI or module error occurred.
- 500.11: The application on the web server is shutting down.
- 500.12: The application is currently being restarted on the web server.
- 500.13: The web server is overloaded.
- 500.15: No direct requests for global.asax are permitted.
- 500.19: Invalid configuration data.
- 500.21: Module not found.
- 500.22: In Managed Pipeline mode, an ASP.NET httpModules configuration is ineffective.
- 500.23: In Managed Pipeline mode, an ASP.NET httpHandlers configuration does not apply.
- 500.24: In Managed Pipeline mode, an ASP.NET impersonation configuration is not applicable.
- 500.50: A rewrite error occurred while handling RQ_BEGIN_REQUEST notifications. An error in configuration or inbound rule execution happened.
- 500.51: A rewrite error occurred during the handling of the GL_PRE_BEGIN_REQUEST notification. There was a global configuration or global rule execution error.
- 500.52: A rewrite error occurred while handling RQ_SEND_RESPONSE notifications. An outbound rule execution happened.
- 500.53: A rewrite error occurred while handling RQ_RELEASE_REQUEST_STATE notifications. There was an outbound rule execution error. The rule is set up to run before the output user cache is updated.
- 500.100: Internal ASP error.
500 Errors Impact on SEO
An HTTP Error 500 WordPress could hurt SEO if not resolved immediately. In case, your website is only down for 10 minutes and is continuously crawled. So the crawler will often easily get the page delivered from the cache. Besides that, Google may not re-crawl it before it goes back online. In this case, you’re perfectly fine.
However, in case the site is down for a longer length of time like more than 6 hours, Google may interpret the 500 error as a site-level problem that must be resolved. Therefore, this could affect your rankings. In case you’re concerned about repeating 500 errors. So you should first figure out why they’re happening. Some of the solutions listed below may be useful.
What Causes Internal Server Error in WordPress?
The internal server error is not only for WordPress. It can occur on any website on a web server. Because of the generic nature of this error, it provides no information to the developer.
Plugin or theme functions in WordPress lead to internal server errors. We know two other possible causes of internal server errors in WordPress: a corrupted .htaccess file and a PHP memory limit.
We’ve also heard of internal server errors appearing only when attempting to access the admin area, while the rest of the site functions normally.
How To Fix The 500 Internal Server Error?
Reloading The Page
Firstly, when facing a 500 internal server error, you should wait a minute and reload the page (F5 or Ctrl + F5). The host or server may be simply overloaded. Besides that, you also can load other sites to rule out that problem.
Another option is to enter the website into downforeveryoneorjustme.com. This website will notify you if the site is unavailable or if your site has a problem. Furthermore, this tool examines the HTTP status code returned by the server. It will return a down indication in case it is anything other than 200 “Everything is OK.”
This can happen after you update a plugin or theme on your WordPress site. This usually happens on hosts that aren’t properly configured. Normally, they are experienced with a temporary timeout. However, most issues are resolved in a matter of seconds.
Clear The Browser Cache
Clearing your browser cache is always a good troubleshooting stage before going deeper into your site’s debugging.
Check The Server Logs
You should also use the information in your error logs. This can help you narrow down the problem quickly, especially in cases caused by a plugin on your site. In case your server doesn’t provide a logging tool. So by adding the following code to your wp-config.php file, you can activate debugging mode in WordPress:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
The logs are kept in the /wp-content folder.
You may also look at the log files in Apache and Nginx, which can be found here:
Apache: /var/log/apache2/error.log
Nginx: /var/log/nginx/error.log
Moreover, you can use our analytics tool. Therefore, you can get a summary of the total number of 500 errors, as well as how frequently and when they occur. This can assist you in figuring out if the problem is still there or if it has already been resolved.
You can also try activating PHP error reporting in case the 500 error is caused by a fatal PHP error. Simply add the code below to the file that is causing the problem. In most cases, you can narrow down the file in the Google Chrome DevTools terminal tab.
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
You may also need to make the following changes to your php.ini file:
display_errors = on
Error Establishing A Database Connection
A database connection issue can also result in 500 internal server errors. Depending on your browser, you may notice a variety of errors. However, in your server logs, both will create a 500 HTTP status code.
An example of a “problem establishing a database connection” notice in your browser is below. The entire page is blank since the connection is down. Moreover, no data can be retrieved to render the page. This not only breaks your site’s front end but also prevents you from accessing your WordPress dashboard.
Check Your Plugins And Themes
Internal server 500 problems are caused by third-party plugins and themes. Deactivating all of your plugins is one approach to troubleshooting this. Remember that merely deactivating a plugin will not result in any data loss. If you still have access to your admin, you can deactivate plugins by going to “Plugins” and selecting “Deactivate” from the bulk actions menu. All of your plugins will be disabled as a result of this.
If this resolves the problem, you’ll need to identify the source of the problem. Begin activating them one at a time, you should reload the page after each one. You’ve found the problematic plugin if you see the 500 internal server error return. Besides that, you can then contact the plugin’s creator or submit a support ticket in the WordPress repository for assistance.
Furthermore, you can FTP access your server and change your plugins folder to something like plugins old in case you can’t connect to WordPress admin. Then double-check your website. In case it works, you’ll need to test each plugin individually. Then, you should rename your plugin folder to “plugins”. You might also try recreating this on a test site first.
Ensure your plugins, themes, and WordPress core are all up to date at all times. Also, make sure you’re using a PHP version that’s supported. In case the problem is caused by faulty code in a plugin. So you may need to hire a
WordPress developer to resolve the problem.
Reinstall WordPress Core
WordPress core files can become corrupted at times, especially on older sites. Re-uploading just the core of WordPress without affecting your plugins or themes is pretty simple.
Error With Permissions
A 500 internal server error might also be caused by a permissions error with a file or folder on your server. Coming to file and folder permissions in WordPress, here are some common recommendations:
- 644 (-rw-r–r–) or 640 for all files.
- 755 (drwxr-xr-x) or 750 for all directories.
- 777 should never be provided to any directory, including upload directories.
- Hardening: To prevent other users on the server from viewing wp-config.php, change it to 440 or 400.
For a more detailed explanation, see the WordPress Codex article on altering file permissions.
With an FTP client, you can simply examine your file permissions (as seen below). You might also contact your WordPress host’s support staff. Moreover, you can request that they rapidly GREP file permissions on your directories and files to confirm that everything is in order.
PHP Memory Limit
Your server’s PHP memory limit may have been reached, resulting in a 500 internal server error. Therefore, you could try putting a higher limit on it. To adjust this restriction in cPanel, Apache, your php.ini file, and your wp-config.php file, follow the methods below:
In cPanel, increase the PHP memory limit.
If you’re on a cPanel-based host, you can easily update this from the UI. Select “Select PHP Version” under Software.
Select “Switch to PHP Options”
After that, you may adjust the value of the memory limit attribute by clicking on it. Then select “Save”
Increase PHP memory limit in Apache
The .htaccess file is hidden. It has numerous settings which can be used to affect server behavior down to the directory level. To begin, log in to your site using FTP or SSH and look for a .htaccess file in the root directory.
If there is, you can add the appropriate code. Therefore, you can increase the PHP memory limit in that file. It’s most likely set to 64M or less; you can try raising it.
php_value memory_limit 128M
Increase PHP memory limit in php.ini File
If the previous steps don’t work, try modifying your php.ini file. Log in to your site via FTP or SSH, then go to the root directory of your site and open or create the php.ini file.
If the file already exists, you can look for the three settings and make any necessary changes. In case, you’ve just made the file or can’t find the options. so you can copy and paste the code below. Moreover, you can change the values to suit your needs.
memory_limit = 128M
For the above php.ini file settings to operate, you may need to add the suPHP directive to your .htaccess file on some shared hosts. To do so, modify your .htaccess file, which is likewise placed at the root of your website, and add the following code near the top:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/yourusername/public_html
</IfModule>
If the above didn’t work for you, it’s possible that your host has the global settings disabled and is instead using.user.ini files. To edit your.user.ini file, go to your site’s root directory and open or create a.user.ini file using FTP or SSH. The following code can then be pasted in:
memory_limit = 128M
Increase PHP memory limit in wp-config.php
The final option isn’t one we recommend, but if everything else fails, it’s worth a go. To begin, you should log into your site via FTP or SSH and look for the wp-config.php file, which is usually located in the root directory.
To the top of your wp-config.php file, add the following code:
define('WP_MEMORY_LIMIT', '128M');
Problem With Your .htaccess File
It’s possible that your .htaccess file has become corrupted or has an issue if you’re utilizing a WordPress host that runs Apache. To make a new one from scratch, follow the below steps:
Firstly, use FTP or SSH to enter your site and change your .htaccess file to .htaccess old.
Typically, you can just re-save your permalinks in WordPress to rebuild this file. In case you’re facing a 500 internal server issue. So you won’t be able to access your WordPress admin panel. Therefore, this isn’t an option. As a result, you can build a new one .htaccess file with the contents listed below. Then you’ll need to upload it to your server.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Coding or Syntax Errors in Your CGI/Perl Script
The frequency of 500 errors produced by CGI and Perl faults is much less common than it once was. Even still, it’s worth highlighting, particularly for people utilizing cPanel, where many one-click CGI programs are still in use. Here are a few pointers for working with CGI scripts, according to AEM on Stack Overflow:
- Always use a plain text editor like Atom, Sublime, or Notepad++ when editing. This guarantees that they stay in ASCII format.
- Ensure that CGI scripts and folders have the proper chmod 755 permissions.
- Upload your CGI scripts to your server’s cgi-bin directory in ASCII mode (which you can pick in your FTP editor).
- Check that the Perl modules you’ll need for your script are installed and working.
Conclusion on HTTP Error 500 WordPress
HTTP Error 500 WordPress is inconvenient, but perhaps you now have a few more options for troubleshooting them. So you can get your site back up and running quickly.
More importantly, our WordPress Website Packages are available to support your Ecommerce business. Our deal discount of up to 30% comes ready to give!
We bring to you the best solutions to gain a high-converting website through: Back-end Updates Services, Front-end Update Services, and Custom WordPress Website Development. Our services are sold at a discounted price. So you get more and spend less!
Contact US – ArrowTheme:
– Email: [email protected]
– Facebook: Facebook.com/ArrowThemeTeam
– Website: ArrowTheme.com