500 Internal Server Error and How to Fix it

The "500 Internal Server Error" is a common HTTP status code indicating a problem with the server. The issue could be due to various reasons, such as a resource limitation, an application error, or an issue with the server-side code. To resolve the issue, the website administrator should check the server logs for errors and troubleshoot the problem.

Causes and Solution for 5oo Internal Server Error

1. Corrupt.htaccess File

A .htaccess file can get corrupted in different ways, it could happen while working on the server or during plugin installation. The reason for such kind of an error is the incorrect syntax of the .htaccess file or the existence of incorrect directives could be the reason you're seeing the 500 internal error.

To resolve this:

  • Locate your .htaccess file through the file manager in cPanel or via FTP/SFTP. The file is located in your public_html directory. Your server might have hidden this file from view by default and you'll need to click on hidden files to see it.
  • Click the rename option to rename the .htaccess file. If this helped and you’ve found out .htaccess is the culprit,
  • Check the error_log file for further troubleshooting if the modification does not work
  • And remember to rename the file and uncomment the lines back.

NOTE: If you are unfamiliar with the syntax, we recommend that you do not make changes or ask your developer to make the changes for you. And also take a backup of your account before making any changes.

2. Incorrect Permissions

Permission error does not allow users to perform the action they are trying to and it will not allow their scripts to run. It could be bugs, user mistakes, or networking problems.

Check to make make sure your permissions are set correctly on your server.

Find below the correct permissions:

files - 0644
folders - 0755
public_html - 0750

3. Reaching LVE limits

You are getting the 500 internal server error because your hosting account is exceeding the
resource limit allotted. You can check using Resource usage page in Cpanel

Check the error_log file to find which script, plugin, etc. causing the issue. Once you know the cause, you should optimize your site performance to ensure it does not hit your account
resource limits anymore.

4. PHP Memory Limit Exceeded

PHP is a server-side scripting language used for managing content, databases, session tracking, etc. Your hosting account has a limit for each process that uses memory. All you need to do is to increase the value set for the PHP Memory to avoid the “Allowed memory size” error. You can set your PHP values by following the steps in this link

5. Faulty Plugins/ Themes

Plugins/themes can also cause 500 Internal Server Errors. In general, the error occurs because of compatibility issues caused by outdated plugins/themes or poorly coded new ones. You might encounter the error after installing a plugin/theme

To find out which of your plugins/themes is causing the error
Deactivate all plugins/themes and see if the error goes away.
If it does, reactivate each plugin one by one to determine which one is causing the problem.

You can also re-upload core files if it is a WordPress website.

If you're still unable to resolve the issue, contact your hosting provider for assistance. They should be able to diagnose and resolve the problem.