Sữa lỗi no response from the server side năm 2024

The “HTTP 500 Internal Server” error is quite general as it can be caused by a broad range of issues. Because of that, you may stumble upon it quite often.

This article will explain the “HTTP Error 500” and how to fix it.

What does “HTTP 500 Internal Server Error” mean?

Error 500, also known as the Internal Server Error, is a common HTTP status code that indicates an issue on the web server’s side. When you encounter an error 500, it means that the server has encountered an unexpected condition or configuration problem that prevents it from fulfilling the request made by the browser or client.

The HTTP status code “500 – Internal Server Error” is one of the many 5.X.X. HTTP error codes [500, 502, 503, 504, etc.]. Each of them specifies a different problem but the common denominator they share is that they tell you something is wrong with the website’s server.

In other words, the hosting server can’t determine the exact problem and display a more specific message. Instead, it responds with the error “500 Internal Server Error” which means that it’s not clear what’s wrong.

You may see different message variations since many websites and web servers customize the error page.

Some variations & examples of the error message include:

  • 500 Internal Server Error
  • Internal Server Error 500
  • HTTP Error 500
  • HTTP Status 500 – Internal Server Error
  • Error 500 Internal Server Error
  • 500 Error
  • 500. That’s an error

Apart from the text, the page’s look may vary for different websites. Below you can see a generic version of the “Internal Server Error” page.

Other times, the page may have a customized design, as seen in the following image.

These are only a few examples of the error page and you can see it in countless variations. Regardless of how the page looks, it always has the same meaning – there is a problem that the server can’t pinpoint, and it prevents you from loading the website.

What are the common problems that can cause HTTP 500 Internal Server Error?

Although the error definition states the issue is from the server, that’s not always the case. Some of the common problems that can cause the error are:

  • Corrupted browser cache
  • Temporary connectivity issues
  • Syntax errors or incorrect rules in the website’s .htaccess file
  • Incorrect file and folder permissions
  • Wrong PHP version for the website
  • Corrupted .htaccess file
  • Corrupted website’s database
  • Problems with WordPress themes and plugins
  • Exhausted PHP memory limit on the website
  • Corrupted WordPress core files
  • Large files on your website
  • Problems with the MySQL server

How to Fix the “500 Internal Server” Error?

As you can see from the list above, the error’s origins are quite diverse. Since the error page will not clearly indicate the problem, you may need to troubleshoot a few of the possible causes until you find the culprit.

How to Fix 500 Internal Server – Video Tutorial

We will go over most of the eventual problems and their solutions.

How to Fix the “HTTP Error 500” as a visitor?

As a visitor, the only thing you can do is check if a connectivity issue from your end causes the error. You can also apply the following actions as a website owner since these are the quickest checks. If the error is caused by a local problem from your end, the steps below can save you a lot of time from troubleshooting.

Reload the page

The “HTTP Error 500” may be visible only for you, in case there was a brief connectivity problem. The website itself may be working fine, but you might have tried to access it when there was a momentary downtime, or your network failed to establish a connection to the website’s server.

Try reloading the page in the same browser with the Reload button or by pressing the keyboard shortcut Command+R for Mac, or F5 [Control+F5] for Windows.

If the website loads correctly, the issue was only temporary, and you can stop troubleshooting.

Clear your browser cache and cookies

When the website doesn’t open after reloading, your browser might be keeping expired or corrupted cache files and cookies. Reloading the page will not delete them, so you must clear them manually.

Read this guide on clearing cache and cookies in desktop browsers for detailed instructions.

Check these articles on deleting the cache on an Android phone or iPhone, if you use a mobile device.

Alternatively, you can test opening the page from another browser. For instance, if you use Chrome, try Firefox or vice versa.

After clearing the browser’s cache, reload the page to see if that solved the problem. If not, proceed with the next step.

Visit the website using another network

The connectivity problems causing the “HTTP 500 Error” may happen across your entire network. In this case, you will probably see the error on any device on this network.

To test if this is the problem, switch to another network. For instance, if you use a mobile phone connected to Wi-Fi, switch to mobile data.

How to Fix the HTTP 500 Internal Server Error from the website?

In the best-case scenario, the steps mentioned above will fix the problem. However, if the error persists, you may need to dig deeper into the issue since the error stems from the website itself.

As a site owner or webmaster, there are several checks you can do that can solve the “500 Internal Server Error.”

Check the Error Logs of the Website

In many cases, misconfigured files or scripts are the sources of the website’s errors. The error logs can help you identify them easier.

Typically, you should have such logs in your hosting’s control panel. SiteGround users can find the Error log in the website’s Site Tools.

To access it, navigate to the Websites section in your Client Area. Open the Site Tools of the respective site, select Statistics and click on Error Log.

You will see the most recent errors on your website that the server detected. Each error will be recorded with a few key pieces of information:

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

Below, you can see an error log indicating a problem with the .htaccess file.

This record indicates that the problem is from the .htaccess file located in the root folder of the website. It also specifies that the error is related to a missing argument, which means there is a syntax error.

Using this information, you can navigate to the specified folder from File Manager, edit the .htaccess file and correct the syntax error.

Keep in mind that the Error log records errors related to the server configuration. Errors caused by PHP misconfiguration and scripts are not recorded, as they happen on application level.

PHP errors are recorded in php_errorlog. It is generated automatically in the folder of the offending PHP file. On SiteGround’s hosting, the PHP error log is active by default. If you have previously deactivated it or your hosting hasn’t enabled it, read this guide on how to enable error reporting in a PHP script.

To inspect the PHP error log, you can use File Manager or FTP client. Navigate to the root folder, if the error is caused by a script located in the root folder. Open the file php_errorlog, where you can examine the errors.

The php_errorlog shows general PHP errors. However, you may need a more detailed log of the problem. If you have a WordPress website, you can also enable the debug log for WordPress that can show more information. For detailed steps on how to enable the WordPress debug log, see this guide.

Reset File and Folder Permissions

Another common problem that can cause the “HTTP 500 Error” is incorrect file and folder permissions on your website. If the permissions prevent visitors from opening the critical website’s files and folders, they may see the error page.

The standard permissions are 644 for files and 755 for folders. You can change them from the File Manager in your hosting panel or from an FTP Client.

For setting the permissions for WordPress sites, SiteGround clients can use the Reset Permissions tool for WordPress in Site Tools.

If your website is using another type of application, read this guide on how to change permissions for files and folders from File Manager.

Alternatively, if your hosting’s panel doesn’t have similar tools, you can change permissions from SSH or from an FTP Client.

Change the PHP version

An incorrect PHP version on your website may cause PHP scripts to time out or produce fatal errors. As a result, the website may return the “HTTP 500 Error.”

Test switching the PHP version to an older or later version. If the error disappears, it’s an indication that the previous version was wrong. Keep the site on the newly selected one.

SiteGround users can easily switch the PHP version with only a few clicks on Site Tools. For detailed steps, check this guide on how to switch to a different PHP version in Site Tools.

Inspect or regenerate the .htaccess file

A common cause of the “Internal Server Error” is a problem within the .htaccess file. If the file is corrupted, it defines an incorrect root folder or contains syntax errors, the usual result is the “HTTP 500 Error” page.

Fix the syntax error in .htaccess

As an example of a syntax error, we can use the previously mentioned error from the error log.

Chủ Đề