The 500 Internal Server Error is a very vague error. In addition to that, there are actually several different issues that can cause the 500 error message to appear. The error will appear to be as follows.
What Causes a 500 Internal Server Error?
If you’re seeing the above error message it means that the server wasn’t able to fulfill a request properly. The Error Code 500 is a general error message and is caused by a mistake in the configuration somewhere on your site or a script that you’re using. It doesn’t tell you specifically what the issue is, as it’s a general error. The most common reasons for a 500 Internal Server Error are:
- Invalid or Incorrect php.ini file
- Invalid lines in the .htaccess file
- Invalid File permissions
- Invalid script requests
- Invalid ownership
- Misconfiguration in the web server configuration.
How to fix a 500 Internal Server Error?
There are several reasons as to what could be causing a 500 Internal Server Error, however, in this guide we will troubleshoot and fix the most common ones. At any step, if you are not able to follow the outlined steps, please get in touch with our support team and they will be happy to assist.
Remove any php.ini files
The way our cPanel hosting infrastructure is set up does not require you to create your own php.ini files in order to edit or adjust your PHP settings. If you have a php.ini file within the directory of your website, please either remove it or rename it to something like php.ini.bak and try refreshing your website. If you need to make changes to your PHP settings follow this guide instead – How to Change the PHP version in cPanel using the Select PHP Version Tool
Correct your .htaccess file
This is by far the most common reason for 500 Internal Server Errors. Follow the steps below to troubleshoot this.
Login to your cPanel account – How to login to cPanel?
Go to the File Manager in your cPanel
Set your File Manager to show hidden files
Rename your .htaccess file to something like .htaccess.bak
Refresh and check if the error still appears.
If the error no longer appears, then it’s a problem with your .htaccess file. Change it back to the original name (.htaccess) and start removing pieces of the code within the .htaccess file to identify which line is the problem. To do this easily and safely just put a number sign (#) without the parenthesis at the start of one line.
This will “comment out” that line so it’s not “read” when your site is loaded.
Do one line, then check to see if the error persists. If it does, add it to the next line and check again. Once you’ve found the problem line and fixed or removed it, remember to uncomment all the other lines.
If you check all the lines and the problem persists, move on to the next section.
Fix your File Permissions
Files and folders should have specific permissions set for them. You can see what they’re set to and change them by going to the File Manager in your cPanel and look for “Permissions.” The most common permission for folders should be 0755 and for files it should be 0644. To change the file permissions do as follows.
Login to your cPanel and Open the File Manager
Change the Permissions as follows
Change your PHP Version
Sometimes a 500 Internal Server Error may also appear due to your PHP scripts or applications being incompatible with the current PHP Version that your account is set to. In this case, you can try by changing the PHP version either going up or going down and refreshing your website after each change.
Problems With WordPress Themes And/Or Plugins
Sometimes a 500 error can be caused by WordPress plugin or theme.
If the error shows up after you’ve installed a new plugin:
- Go to your File Manager
- Go to the public_html/wp-content/plugins folder
- Rename the folder for each plugin one at a time
If the error shows after you’ve installed a new theme:
- Go to your File Manager
- Go to the public_html/wp-content/themes folder
- Rename the folder for the theme
If that fixes the site, try reinstalling the theme or plugin. If it throws the error again, simply change the name and leave it.
If nothing here solves the problem, please get in touch with us on live chat or submit a ticket so we can help you get it sorted and your site back online.