What is the difference between fastcgi and cgi
Difference analysis:
(Recommended learning: nginx tutorial)
cgi
web server will According to the content of the request, a new process will be forked to run the external C program (or perl script...). This process will return the processed data to the web server. Finally, the web server will send the content to the user. The process just forked will also Then exit.
If the user requests to change the dynamic script next time, the web server will fork a new process again, and the process will continue again and again.
fastcgi
When the web server receives a request, it will not re-fork a process (because this process is started when the web server starts and will not exit). The web server directly Pass the content to this process (inter-process communication, but fastcgi uses another method, tcp communication). This process processes the request after receiving it, returns the result to the web server, and finally waits for the next request to arrive. Instead of quitting.
To sum up, the difference lies in whether to repeatedly fork the process and process the request.
The above is the detailed content of What is the difference between fastcgi and cgi. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

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)

Hot Topics



How to use PHP and CGI to implement user registration and login functions User registration and login are one of the necessary functions for many websites. In this article, we will introduce how to use PHP and CGI to achieve these two functions. We'll demonstrate the entire process with a code example. 1. Implementation of the user registration function The user registration function allows new users to create an account and save their information to the database. The following is a code example to implement the user registration function: Create a database table First, we need to create a database table to store user information. Can

File upload and download technology with PHP and CGI: How to implement file management functions Introduction: File upload and download are one of the common functions in modern web applications. This article will introduce how to implement file upload and download functions using PHP and CGI programming languages, and show some code examples to demonstrate how to manage uploaded and downloaded files. Here’s what we’re going to cover: Basic concepts of file upload using PHP to implement file upload CGI to implement file upload Basic concepts of file download using PHP to implement file download CGI implementation under the file

How to use PHP and CGI to implement the video playback function of the website In today's multimedia era, video has become an indispensable part of the website content. In order to provide a good user experience, the website needs to implement video playback function. This article will introduce how to use PHP and CGI to implement the video playback function of the website, and provide code samples for reference. 1. Preparation Before starting, you need to ensure that the server has PHP and CGI modules installed. You can do this by running the phpinfo() function or typing "php

CGI is a protocol and has nothing to do with the process. For example, when the web server (nginx) receives a PHP network request, nginx needs to find the PHP parser according to the configuration file. After simple processing, some of the requested information is handed over to The PHP parser stipulates which protocols are to be transmitted and the format in which they are transmitted. This standard is called the cgi protocol.

Comparison of PHP and CGI technologies: How to choose the right website for you With the development of the Internet, CGI (Common Gateway Interface) and PHP (Hypertext Preprocessor) have become one of the most commonly used website development technologies. This article will compare these two technologies to help you choose the right development technology for your website. 1. Overview PHP is a very popular server-side scripting language that is widely used for dynamic website development. It is open source, supports multiple operating systems, and has powerful database connection and processing capabilities. Developers can use simple syntax

Working principles and similarities and differences In web development, PHP is a commonly used programming language that can interact with web servers in different ways, the most common of which are through PHPCLI (CommandLineInterface) and PHPCGI (CommonGatewayInterface). This article will explore the working principles, similarities and differences between PHPCLI and CGI, and provide specific code examples to illustrate the differences between them. 1. PHP

PHP and CGI template engines: How to achieve website reusability Introduction: When developing websites, we often need to deal with the display of dynamic content. In order to achieve code maintainability and reusability, using a template engine is a wise choice. This article will introduce PHP and CGI, two commonly used template engines, and show how to use them to achieve website reusability through code examples. 1. PHP template engine PHP is a widely used server scripting language with flexibility and powerful functions. PHP template engine is a

How to use PHP and CGI to implement the paging and sorting functions of a website Preface Paging and sorting of a website are very common and important functions, especially for the display and processing of large amounts of data. In this article, we will use PHP and CGI (Common Gateway Interface) technology to implement the paging and sorting functions of the website, with corresponding code examples. 1. Implementation of paging function The paging function mainly obtains a specific range of data by querying the database, and displays the data according to the specified page number and display quantity per page. The following are the steps to implement paging functionality
