Errors 500, 502, 503, 504 and 508. Reasons and ways of fixing

500 error: Internal Server Error

502 error: Bad Gateway

503 error: Service Unavailable

504 error: Server is unavailable

508 error: Resource Limit Is Reached



500 error: Internal Server Error




What does it mean?

The Web server encountered an unexpected condition that prevented it from fulfilling the request by the client for access to the requested URL.

Why does it appear?

1. .htaccess file

The most widespread reason of such kind of an error is the incorrect syntax of the .htaccess file or existence of incorrect directives in it.

.htaccess file can be found in cPanel > File Manager menu with the help of this guide.

We recommend starting re-naming the .htaccess file temporarily to understand whether the issue is related to it or not. You can use FTP or cPanel File Manager > Rename option. If this helped and you’ve found out .htaccess is the culprit, start commenting out lines in .htaccess by adding # to the beginning of each line one by one.

NOTE: It is strongly recommended to avoid making changes to the content of the file if you are not familiar with its syntax. Also, we recommend having a backup copy of the file at all times.

In case the error does not disappear after the .htaccess file modification, you need to check the error_log file and the latest PHP error records in it.

Do not forget to rename the file and uncomment the lines back.

2. Incorrect permissions of a file or directory

That can be another reason for 500 error. Permissions can be corrected in cPanel > File Manager > Change Permissions. Refer to this guide for more detailed instruction.

Mind the correct permissions:

files - 0644
folders - 0755
public_html - 0750


3. Reaching LVE limits

It is possible the error is caused by the fact that your hosting account is exceeding virtual resource limit. There are several ways of checking it:

Resources Usage page in cPanel.
Through SSH tunnel. The Linux top -c command will show real-time information and statistics about your running processes.

NOTE: SSH is not enabled by default. Follow this guide to enable it from your side or contact our Hosting team via Live Chat or email us to support@namecheaphosting.com.

Solution: If your account is reaching its LVE limits, we recommend checking the error_log file and the latest error messages to find which script, plugin, etc. causes the issue. Once you know the cause, you should optimize your site/account performance to ensure it does not hit your account resource limits anymore.

4. ModSecurity

In rare cases, this error may appear due to the triggered mod_security rule. You can manage ModSecurity with the help of this guide.

If the steps above did not help, contact our Hosting team via Live Chat.

502 error: Bad Gateway




What does it mean?

The server received an invalid response from another server it was accessing while attempting to load the web page or fulfill another request by the browser.

Why does it appear?

It appears when the web server is not able to process the request. Such error can be connected with the incorrect functionality of a proxy server, DNS server or hosting server itself. Below you can find the most common reasons for the error:

1. The increasing load on a server. It may be caused by resource intensive activity of some cPanel users, internal server technical failure or lack of server resources to process all incoming requests.

2. Our technical team catches such errors during the regular monitoring, and it generally takes from 10 to 30 minutes to fix it and restore normal functionality.

So if you receive 502 error while trying to access your site, try to access it in 10 minutes again and if the error is still there, contact our Live Support team.





What does it mean?

This error indicates that the server is unable to process the request properly.

Why does it appear?

The Webserver is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server.
Also among reasons can be:
 - inodes/disk overusage;
 - irrelevant php.ini/htaccess directives;
 - incorrect PHP version used;
 - lack of memory etc.

Solution:

1. Switch PHP versions;
2. Check disk space and inodes usage, etc.;
3. Check error logs and the latest error messages to find which script, plugin, etc. causes the issue;
4. Check our status blog or contact our support team to ensure the server is up and running.

If the solutions above have not helped, contact our Hosting team via Live Chat or email us to support@namecheaphosting.com.

504 error: Server is unavailable




What does it mean?

The server received an invalid response from another server it was accessing while attempting to load the web page or fulfill another request by the browser.

Why does it appear?

The reasons for this error are almost the same as for 502 error. The difference is that unlike 502 error where the invalid response was received from the server, the response was not received at all within a specific time frame. Thus, the request timed out stating that the server is unavailable. That means that during the highest load peaks, Apache is not able to process the number of requests and put them into a queue.

Since the error is in 90% of cases connected with the server load, and all services are monitored, our Technical Team is notified about the issue right away and is able to resolve it within 10-30 minutes. Once more, the possible reason is the script in your account that requires more time to execute than it is configured on the server by default.

Solution: Check our status blog or contact our support team to ensure the server is up and running. If the server’s performance is normal, most probably one of your scripts requires more time to execute. The solution for this case is to increase the PHP time limit for script execution. It can be done in the php.ini file by increasing max_execution_time value. Note that the LSPHP directive in .htaccess should already contain the correct php.ini path. The optimization of a script performance is the second way of fixing the issue.

508 error: Resource Limit Is Reached




What does it mean?

It means that your website is hitting Entry Processes.

Why does it appear?

Each LVE limits the number of entry processes (web server processes entering into LVE) to prevent single site exhausting all web server processes. If the limit is reached, then mod_hostinglimits will not be able to place web server process into LVE and will return error code 508. You can check the resource usage of your account by logging into cPanel > Resources Usage menu or in real time using the SSH command top -c. If the error appears too often, optimization of scripts or an account upgrade to the plan with higher server resource limits will be required.

Solution:

1. If you are a WordPress user, refer to our specially created article.
2. In case you have a Dedicated Server with CloudLinux installed, you can use LVE Manager to control resource limits for a particular user or modify limits for the packages.
3. If it is a permanent issue and the above suggestions did not help, then it is recommended to consider upgrading your hosting plan to the package with higher server resource limits. Remember this article describes the most common reasons of the errors and common practices to fix them. If the recommendations do not help, contact our Hosting team via Live Chat or email us to support@namecheaphosting.com.
Updated
Viewed
118556 times

Need help? We're always here for you.

notmyip