Home > Article > Operation and Maintenance > How nginx and php handle user requests
Nginx and PHP process user request steps:
1. The client (browser) makes a request operation (enter the URL, click the link ,submit Form).
2. The client resolves the domain name and requests the IP address from the set DNS server.
3. The client uses the three-way handshake to establish a TCP/IP connection with the server based on the IP address returned by the DNS server.
4. After the TCP/IP connection is successful, the client sends an HTTP request to the server.
5. The server-side Web Server will determine the resource type of the HTTP request and perform content distribution processing; if the requested resource is a PHP file, the server-side software will start the corresponding CGI program for processing and return the processing result.
6. The server responds to the client with the processing results of the Web Server. The client receives the response from the server and renders the processing results. If the response content requires requesting other static resources, access the required resources through CDN to accelerate access.
7. The client presents the rendered view and disconnects the TCP/IP connection.
Recommended tutorial: Nginx tutorial
The above is the detailed content of How nginx and php handle user requests. For more information, please follow other related articles on the PHP Chinese website!