Home
/
Website Help
/
Stats and Errors
/
What Is ‘HTTP Error 500 - Internal Server Error’ and How to Fix It?

What Is ‘HTTP Error 500 - Internal Server Error’ and How to Fix It?

There are a number of reasons that can cause the common ‘HTTP Error 500 – Internal Server Error’: WordPress plugin or theme functions, corrupted .htaccess file, and having a very large file as a part of your website. Here are effective ways to solve this problem.

Disable plugins

Try to disable your plugins from the database or via your dashboard. Follow the instructions in this article in order to disable them directly from the database.

To disable your plugins through the dashboard, log into your WordPress admin dashboard > Plugins > Deactivate. Reload your website to see if the error has been resolved.

Only after trying the methods above, and if the error still persists, disable the plugins by renaming the respective folders. Before making that change, make a backup of your website’s files and database from Site Tools > Security > Backups. Then, go to SiteGround Client Area > Websites > Site Tools next to the desired website and click Site > File Manager. In the left column of File Manager, find the specific folder of the redirection plugin and change its name.

.htaccess file

Log into your SiteGround Client Area > Websites > Site Tools next to the desired website. Then, go to Site > File Manager > root directory (public_html) and navigate to the .htaccess file.

Right-click on the .htaccess file, select Rename and rename the file to ‘.htaccess_backup’ in order to keep a backup, then click Confirm. Try visiting and reloading your site to see if this solved the problem.

If it did, go to your WordPress dashboard > Settings > Permalinks > click on the Save Changes button without making any changes. This will generate a new .htaccess file for you with the proper rewrite rules to ensure your pages don’t return a ‘404 error’.

Files and folders permissions

In case the file and folder permissions are not set properly, opening the website can also result in ‘500 Internal Server Error.’ The permissions can be reset from your Site Tools> WordPress> Install & Manage > Reset Permissions (from the Actions menu on the right).

Server logs

Alternatively, you can try checking the server error logs. Customers can do this via Site Tools > Statistics > Error Log. There you will see a list of the last error messages generated by your website. In this list, you will find information about each error including:

  • The date and time of the error.
  • Description of the error.
  • Information about which folder or file is possibly generating the error.

Here are some examples of the most common issues that can generate a 500 Internal Server Error:

[Mon May 29 10:34:16.770700 2017] (13)Permission denied: [client 127.0.0.76] 
/home/user/public_html/.htaccess unable to check htaccess file, ensure it is readable

The error above is mostly caused by incorrect permissions of the .htaccess file or the folder it is in (in the example below that would be the public_html folder). You need to ensure that the .htaccess file has 644 permissions and your directories have 755 permissions. To modify the files/folders permissions use SSH, FTP, or File Manager in Site Tools.

[Mon May 29 10:34:16.770700 2017] [client 127.0.0.76] /home/user/public_html/.htaccess:
 Invalid command, perhaps misspelled or defined by a module not included in the server
 configuration

The error shows that there are incorrect directives inside the specific .htaccess. Make sure to revert any recent change with the .htaccess, as they are the most probable cause.

[Tue May 30 04:22:08.084009 2017] [core:error] [pid 23000] [client 82.118.240.253:40236] 
End of script output before headers: filename

This error happens when the permissions of one of your files are too open. In the example above, filename would be the name of the file in question. To resolve it, change the permissions of the problematic file to 644. These are also the recommended permissions for all your website files.

[Thu Apr 19 01:47:39 2017] [client 127.0.0.76] Premature end of script headers: 
/home/user/public_html

Large file on your site

Another common reason for this error to occur is having a very large file as a part of your website. On SiteGround’s shared hosting servers there is a size limit for files that can be opened through the web. The limit is 8GB, and if your website includes a larger file, this will result in the above error.

Check your website’s files either via SSH, FTP, or the File Manager to locate the one causing the problem. Very often these are logs with PHP errors. On SiteGround’s servers, a log file is created automatically if your site’s PHP scripts produce any non-critical errors or warnings during their execution. The log file’s name is php_errorlog and it is located in the same directory as the script that produced the errors. Usually, this would be your site’s directory.

Share This Article