500 Internal Server Error

HTTP 500 內部伺服器錯誤 伺服器錯誤響應狀態碼錶示伺服器遇到意外情況,阻止它完成請求。此錯誤是對伺服器問題的通用“包羅永珍”的響應,表明伺服器找不到更合適的 5XX 錯誤來響應。

如果您是訪問者,在網頁上看到 500 錯誤,這些問題需要伺服器所有者或管理員進行調查。500 錯誤有許多可能的原因,包括:不正確的伺服器配置、記憶體不足 (OOM) 問題、未處理的異常、不正確的檔案許可權或其他複雜因素。伺服器管理員可以主動記錄伺服器錯誤響應的發生情況,例如 500 狀態碼,並附帶有關發起請求的詳細資訊,以提高服務在未來的穩定性。

狀態

http
500 Internal Server Error

示例

500 伺服器錯誤響應

以下請求嘗試獲取一個網頁,但收到 500 響應。響應正文包含一個描述伺服器狀態的頁面,其中包含指向訪問者支援頁面的連結。響應正文中包含一個識別符號,用於說明一種可能有助於伺服器管理員縮小問題根本原因的方法

http
GET /highlights HTTP/1.1
Host: example.com
User-Agent: curl/8.6.0
Accept: */*
http
HTTP/1.1 500 Internal Server Error
Content-Type: text/html;
Content-Length: 123

<!doctype html>
<html lang="en">
<head>
  <title>500 Internal Server Error</title>
</head>
<body>
  <h1>Internal Server Error</h1>
  <p>The server was unable to complete your request. Please try again later.</p>
  <p>If this problem persists, please <a href="https://example.com/support">contact support</a>.</p>
  <p>Server logs contain details of this error with request ID: ABC-123.</p>
</body>
</html>

規範

規範
HTTP 語義
# status.500

另見