HTTP 500 / 502
HTTP 500 is often caused by errors in .htaccess or the PHP code, while HTTP 502 occurs with oversized headers or cookies – find and fix the plugin or script.
HTTP 500
.htaccess file
Error 500 usually occurs when there is a syntax error in the .htaccess file on your web hosting. Errors in .htaccess files can occur if your site has been compromised or if you or your CMS have inserted invalid commands into it.
You can check the log files to see whether any errors have been recorded; this is done under "Website" > "Webserver logs" in our Control Panel.
You can rename the .htaccess file to confirm whether it is the one causing problems, then check the file for errors and correct them.
PHP code errors
The error can also occur if there is a PHP code error on your web hosting (and the display of PHP errors is disabled); this can happen, among other things, if your web hosting has run out of space or if code changes have been made. Make sure your CMS is configured to display code errors.
HTTP 502
An HTTP 502 error (Bad Gateway) can occur if your website sends a response with HTTP headers that are too large. This typically happens if a plugin or script sets many or very large cookies, or sets the same cookie many times in a single response.
You can resolve the problem by finding the plugin or script that sets the many cookies or headers, e.g. by disabling your plugins one at a time and testing again. Clearing cookies in your browser does not help, as it is the website's own response that is too large.
Note: If there are too many cookies in your browser, you will instead get the error 400 Bad Request – Request Header Or Cookie Too Large. This can be resolved by clearing cookies for the website in your browser.
Article from the support category: PHP