PHP outputs http status codes and common status codes
Aug 08, 2016 am 09:19 AMheader("HTTP/1.1 403 Forbidden"); echo <<<sql <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" c minimum-scale=1, width=device-width"> <title>Error 404 Not Found</title> </head> <body> <H1>Not Found</H1> <p><ins>That’s an error.</ins></p> <p>The requested URL <code><?php echo dirname({$_SERVER["SCRIPT_NAME"]});?></code> was not found on this server. <ins>That’s all we know.</ins></p> </body> </html> <HTML> <HEAD> <meta charset="utf-8"> <TITLE>404 Not Found</TITLE> </HEAD> <BODY> <H1>Not Found</H1> The requested URL <?php echo dirname({$_SERVER["SCRIPT_NAME"]});?> was not found on this server.<P> <HR> <ADDRESS>Web Server at {$_SERVER["SERVER_NAME"]} Port {$_SERVER["SERVER_PORT"]}</ADDRESS> </BODY> </HTML> sql;
http://www.w3.org/Protocols/rfc2616/rfc2616
Hypertext Transfer Protocol -- HTTP/1.1
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
100-199 Used to specify certain actions that the client should respond to.
200-299 is used to indicate successful understanding and acceptance of the request.
300-399 is used for files that have been moved and is often included in the location header information to specify the new address information.
400-499 is used to indicate client errors.
500-599 is used to support server errors.
[Informational 1xx] Informational
100="Continue" Continue: If the server receives a request with 100-continue in the header, this means that the client asks whether it can send attachments in subsequent requests. In this case, the server uses 100 (SC_CONTINUE) to allow the client to continue or 417 (Expectation Failed) to tell the client that it does not agree to accept the attachment. This status code is new in HTTP 1.1.
101="Switching Protocols" Switching protocols: The server understands and is willing to comply with the client's requirements and change the application protocol used in this connection by upgrading the message header field.
[Successful 2xx] Success
>>>200="OK" Success
201="Created" Created: The request has been completed, resulting in the creation of a new resource. Its URL should be given in the positioning header information.
202="Accepted" Accepted: The processing request has been accepted, but the processing has not been completed.
203="Non-Authoritative Information" Non-authorized information
>>>204="No Content" No content: The server has completed the request, but did not return any content.
205="Reset Content" Reset content: The server has completed the request, and the user agent should reset the document view that caused the request, used to force the browser to clear the form fields. This is new in HTTP 1.1.
206="Partial Content" Partial Content: Sent when the server completes a partial request containing Range header information
[Redirection 3xx] Redirect
300="Multiple Choices" Multiple Choices: Indicates that the requested document can Found in multiple places and will be listed in the returned document. If the server has preferences, the preferences will be listed in the location response header.
>>>301="Moved Permanently" Permanently moved: The requested resource is assigned a new permanent URI and any future references to this resource should use this returned URI. The browser will automatically connect to the new URL. NOTE: When automatically redirecting a POST request that receives a 301 status code, some existing HTTP/1.0 user agents will incorrectly change that to a GET request
>>>302="Found" Found: Requested resource Temporarily resides in a temporary URI. Somewhat similar to 301, except that the URL given in the positioning header information should be understood as a temporary exchange address rather than a permanent one. Note: In HTTP 1.0, messages are moved temporarily (Moved Temporarily) rather than discovered
303="See Other" See Other: The response to this request can be at a different URI and should be retrieved using the GET method of the resource . Similar to 301 and 302, except that if the original request was POST, the new document (given in the positioning header information) must be retrieved using GET. This status code is new to HTTP 1.1.
>>>304="Not Modified" Not modified: If the client performs a GET request conditionally and allows access, but the file has not been modified, the server should respond with this status code.
305="Use Proxy" Use proxy: The location field of the requested resource must be accessed through a proxy. New in HTTP 1.1.
306="(Unused)" (Unused) The 306 status code uses the previous version of the specification and is no longer used. The code is reserved
307="Temporary Redirect" Temporary redirection: The requested resource temporarily resides in a Different URIs. The rules for browsers to handle 307 status are the same as 302. The 307 status was added to HTTP 1.1 because many browsers performed an incorrect redirect when receiving a 302 response, even when the original message was a POST. The browser is assumed to redirect on a POST request only if a 303 response is received. The purpose of adding this new status code is clear: when the response is 303, it will be redirected to GET and POST requests; when the response is 307, it will be redirected to GET requests instead of POST requests.
[Client Error 4xx] Client error
>>>400="Bad Request" The server does not understand the syntax of the request.
>>>401="Unauthorized" Unauthorized: The request requires user authentication. If the request already contains an authorization certificate, the 401 response indicates that the credentials have been rejected. This response must contain a WWW-Authenticate authorization header.
402="Payment Required" Payment required: This code is reserved for future use.
>>>403="Forbidden" Forbidden: The server understands the request, but refuses to fulfill it.
>>>404="Not Found"
405="Method Not Allowed" Not allowed: The method specified in the request line is not allowed to request the resource identified by the URI. Indicates that the request method (GET, POST, HEAD, PUT, DELETE, etc.) is not allowed for certain resources.
406="Not Acceptable" Not acceptable: Indicates that the MIME type of the requested resource is inconsistent with the type specified in the Accept header information in the client.
407="Proxy Authentication Required" Proxy Authentication: This code is similar to 401 (Unauthorized), but means that the client must authenticate it first.
408="Request Timeout" Request timeout: The client did not generate a request during the time the server was ready to wait. New in HTTP 1.1.
409="Conflict" Conflict: The request cannot be completed due to a conflict with the current state of the resource. This status is usually used with PUT requests. The 409 status is often used when trying to upload an incorrect version of a file. This status code is new to HTTP 1.1.
>>>410="Gone" Gone: The requested resource is no longer an available server and has no forwarding address. Tells the client that the requested document no longer exists and has no updated address. The 410 status is different from 404. 410 is used when the guidance document has been moved, while 404 is used for inaccessibility for unknown reasons. This status code is new to HTTP 1.1.
411="Length Required" Length required: The server refuses to accept the request without defining the content length. Indicates that the server cannot process the request (assuming a POST request with an attachment) unless the client sends a Content-Length header indicating the size of the data to be sent to the server. This state is new to HTTP 1.1.
412="Precondition Failed" Precondition failed: The precondition given in one or more request header fields when one or more request header fields are tested on the server. Indicates that certain prerequisites in the request headers are incorrect. This state is new to HTTP 1.1.
413="Request Entity Too Large" The request entity is too large: Tells the client that the requested document is larger than the server currently wants to process. If the server thinks it can be processed after a while, it will include a Retry-After response header. This state is new to HTTP 1.1.
414="Request-URI Too Long" The request URI is too long: The status is used when the URI is too long. The "URI" referred to here refers to the content after the host, domain name and port number in the URL. Newly added to HTTP 1.1.
415="Unsupported Media Type" Unsupported media type: The format type of the attachment attached to the request is not known by the server. This state is new to HTTP 1.1.
416="Requested Range Not Satisfiable" The request range does not meet: Indicates that the client contains a request with Range header information that the server cannot satisfy. This state is new to HTTP 1.1.
417="Expectation Failed" Expectation failure: If the server gets an Expect request header with a 100-continue value, this means that the client is asking whether it can send attachments in subsequent requests. In this case, the server will also use the status (417) to tell the browser that the server does not accept the attachment or use the 100 status to tell the client that it can continue to send the attachment. This state is new to HTTP 1.1.
[Server Error 5xx] Server Error
>>>500="Internal Server Error" Internal Server Error
>>>501="Not Implemented" Unable to execute: The server does not support the functionality required to complete the request . Tells the client that the server does not support the functionality requested in the request. For example, the client executes a command such as PUT that the server does not support.
>>>502="Bad Gateway" Bad Gateway: The server, acting as a gateway or proxy, received an invalid response from the upstream server while trying to satisfy the access request. This status indicates that the receiving server received an error response from the remote server.
>>>503="Service Unavailable" Service Unavailable: The server is currently unable to process requests due to temporary overload or server maintenance. Some servers may wish to simply refuse the connection. For example, the server should return this header if some threads or database connection pools are no longer free. The server can provide a Retry-After header to tell the client when it can try again.
504="Gateway Timeout" Gateway timeout: It indicates that the receiving server did not get a timely response from the remote server. This state is new to HTTP 1.1.
505="HTTP Version Not Supported" HTTP version is not supported: The server does not support, or refuses to support, the version of the HTTP protocol that is used in the request message. This state is new to HTTP 1.1.
Concise version:
Successful 2XX status code that successfully processed the request.
200 The server has successfully processed the request and served the requested web page.
204 The server successfully processed the request but did not return anything. 每 The redirection of the redirection to the 3xx request for each request should not be used for more than 5 times.
301 The requested web page has been permanently moved to a new location. When URLs change, use the 301 code. Save the new URL in the search engine index.
302 The requested web page is temporarily moved to a new location. The original URL is saved in the search engine index.
304 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?llllllllllllll out out out of 304 to be saved if the web page has not been updated since the requester's last request. This can save bandwidth and overhead.
Client error 4XX indicates that the request may be in error, hindering the server's processing.
400 The server does not understand the syntax of the request.
403 The server rejected the request.
404 The server cannot find the requested web page. This code is often returned for web pages that do not exist on the server.
410 The server returns this response after the requested resource is permanently deleted. This code is similar to the 404 (Not Found) code, but is sometimes used in place of the 404 code when the resource previously existed but now does not. If a resource has been permanently deleted, 301 should be used to specify the resource's new location.
Server error 5XX means that an internal error occurred while the server was processing the request. These errors may be errors on the server itself rather than an error in the request.
500 The server encountered an error and was unable to complete the request.
503 The server is currently unavailable (due to overload or downtime for maintenance). Often, this is a temporary state.
Detailed breakdown:
2XX Success
200 Normal; request completed.
201 Normal; immediately followed by POST command.
202 Normal; accepted for processing, but processing has not yet been completed.
203 Normal; partial information — The information returned is only part of it.
204 Normal; No response - The request has been received, but there is no information to be sent back.
3XX Redirects
301 Moved — The requested data has a new location and the change is permanent.
302 Found — The requested data temporarily has a different URI.
303 See Other — The response to the request can be found under another URI and should be retrieved using the GET method.
304 Not Modified — The document was not modified as expected.
305 Use proxy — The requested resource must be accessed through the proxy provided in the location field.
306 Unused — No longer used; retain this code for future use.
4XX Errors in the client
400 Bad Request — There is a syntax problem in the request, or the request cannot be fulfilled.
401 Unauthorized — The client is not authorized to access data.
402 Payment Required — Indicates that the billing system is in effect.
403 Forbidden — No access required even with authorization.
404 Not Found — The server cannot find the given resource; the document does not exist.
407 Proxy Authentication Request — The client must first authenticate itself using a proxy.
415 Unsupported media type — The server refused to service the request because the format of the requested entity is not supported.
5XX Errors in the server
500 Internal error — The server cannot complete the request due to unexpected circumstances.
501 Not executed — The server does not support the requested tool.
502 Bad Gateway — The server received an invalid response from the upstream server.
503 Unable to obtain service — The server was unable to process the request due to temporary overload or maintenance.
504 Gateway Timeout
When a server working as a gateway or proxy tries to execute a request, it fails to receive a response in time from the upstream server (the server identified by the URI, such as HTTP, FTP, LDAP) or the auxiliary server (such as DNS).
Note: Some proxy servers will return a 400 or 500 error when a DNS query times out
505 HTTP Version Not Supported
The server does not support, or refuses to support, the HTTP version used in the request. This implies that the server is unable or unwilling to use the same version as the client. The response should contain an entity describing why the version is not supported and what protocols the server supports.
506 Variant Also Negotiates
Extended by the Transparent Content Negotiation Protocol (RFC 2295) and represents an internal configuration error in the server: the requested negotiation variable resource is configured to use itself in transparent content negotiation, and therefore in a negotiation process Not an appropriate focus.
507 Insufficient Storage
The server cannot store the content necessary to complete the request. This condition is considered temporary. WebDAV (RFC 4918)
508 Loop Detected
The server found an infinite loop in the request
509 Bandwidth Limit Exceeded
The server reached the bandwidth limit. This is not an official status code, but is still widely used.
510 Not Extended
The strategies required to obtain resources are not satisfied. (RFC 2774)
Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the http status code output by PHP and common status codes, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Windows 11 brings fresh and elegant design to the forefront; the modern interface allows you to personalize and change the finest details, such as window borders. In this guide, we'll discuss step-by-step instructions to help you create an environment that reflects your style in the Windows operating system. How to change window border settings? Press + to open the Settings app. WindowsI go to Personalization and click Color Settings. Color Change Window Borders Settings Window 11" Width="643" Height="500" > Find the Show accent color on title bar and window borders option, and toggle the switch next to it. To display accent colors on the Start menu and taskbar To display the theme color on the Start menu and taskbar, turn on Show theme on the Start menu and taskbar

The message "Your organization has asked you to change your PIN" will appear on the login screen. This happens when the PIN expiration limit is reached on a computer using organization-based account settings, where they have control over personal devices. However, if you set up Windows using a personal account, the error message should ideally not appear. Although this is not always the case. Most users who encounter errors report using their personal accounts. Why does my organization ask me to change my PIN on Windows 11? It's possible that your account is associated with an organization, and your primary approach should be to verify this. Contacting your domain administrator can help! Additionally, misconfigured local policy settings or incorrect registry keys can cause errors. Right now

Screen brightness is an integral part of using modern computing devices, especially when you look at the screen for long periods of time. It helps you reduce eye strain, improve legibility, and view content easily and efficiently. However, depending on your settings, it can sometimes be difficult to manage brightness, especially on Windows 11 with the new UI changes. If you're having trouble adjusting brightness, here are all the ways to manage brightness on Windows 11. How to Change Brightness on Windows 11 [10 Ways Explained] Single monitor users can use the following methods to adjust brightness on Windows 11. This includes desktop systems using a single monitor as well as laptops. let's start. Method 1: Use the Action Center The Action Center is accessible

We all have different preferences when it comes to display scaling on Windows 11. Some people like big icons, some like small icons. However, we all agree that having the right scaling is important. Poor font scaling or over-scaling of images can be a real productivity killer when working, so you need to know how to customize it to get the most out of your system's capabilities. Advantages of Custom Zoom: This is a useful feature for people who have difficulty reading text on the screen. It helps you see more on the screen at one time. You can create custom extension profiles that apply only to certain monitors and applications. Can help improve the performance of low-end hardware. It gives you more control over what's on your screen. How to use Windows 11

Many users will choose the Huawei brand when choosing smart watches. Among them, Huawei GT3pro and GT4 are very popular choices. Many users are curious about the difference between Huawei GT3pro and GT4. Let’s introduce the two to you. . What are the differences between Huawei GT3pro and GT4? 1. Appearance GT4: 46mm and 41mm, the material is glass mirror + stainless steel body + high-resolution fiber back shell. GT3pro: 46.6mm and 42.9mm, the material is sapphire glass + titanium body/ceramic body + ceramic back shell 2. Healthy GT4: Using the latest Huawei Truseen5.5+ algorithm, the results will be more accurate. GT3pro: Added ECG electrocardiogram and blood vessel and safety

HTTP status code 520 means that the server encountered an unknown error while processing the request and cannot provide more specific information. Used to indicate that an unknown error occurred when the server was processing the request, which may be caused by server configuration problems, network problems, or other unknown reasons. This is usually caused by server configuration issues, network issues, server overload, or coding errors. If you encounter a status code 520 error, it is best to contact the website administrator or technical support team for more information and assistance.

In iOS 17, Apple introduced several new privacy and security features to its mobile operating system, one of which is the ability to require two-step authentication for private browsing tabs in Safari. Here's how it works and how to turn it off. On an iPhone or iPad running iOS 17 or iPadOS 17, Apple's browser now requires Face ID/Touch ID authentication or a passcode if you have any Private Browsing tab open in Safari and then exit the session or app to access them again. In other words, if someone gets their hands on your iPhone or iPad while it's unlocked, they still won't be able to view your privacy without knowing your passcode

The famous activation script MAS2.2 version supports digital activation again. The method originated from @asdcorp and the team. The MAS author calls it HWID2. Download gatherosstate.exe (not original, modified) from https://github.com/massgravel/Microsoft-Activation-Scripts, run it with parameters, and generate GenuineTicket.xml. First take a look at the original method: gatherosstate.exePfn=xxxxxxx;DownlevelGenuineState=1 and then compare with the latest method: gatheros
