In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you about what cgi is and what are the principles of cgi, fastcgi and php-fpm. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
CGI is the specification of external programs when the Web server is running. The program written according to CGI can extend the server function.
CGI (Common Gateway Interface) is one of the most important technologies in WWW technology, which has an irreplaceable important position. CGI is the interface standard between external applications (CGI programs) and WEB servers, and it is the process of transmitting information between CGI programs and Web servers.
The CGI specification allows Web servers to execute external programs and send their output to Web browsers, and CGI turns a simple set of static hypermedia documents from Web into a complete new interactive media.
Processing steps for CGI:
⑴ sends user requests to the web server through Internet.
The ⑵ web server receives the user's request and hands it over to the CGI program for processing.
The ⑶ CGI program transmits the processing result to the web server.
The ⑷ web server sends the results back to the user.
The principle of cgi
Cgi is a universal gateway interface definition. When web server receives the request / index.php, it starts the corresponding CGI program, which is the parser of PHP. Next, the PHP parser parses the php.ini file, initializes the execution environment, processes the request, returns the processed result in the format specified by the CGI, and exits the process. Web server then returns the results to the browser.
The principle of fastcgi
Fastcgi is a protocol. Implement the management process to improve cgi performance. Standard cgi parses php.ini for each request, initializing the environment, wasting time; fastcgi starts the master process, parses the configuration file, initializes the environment, and then starts multiple worker processes; when the request comes, the master is passed to the worker for processing; if there is not enough worker, there will be several in advance, and several will be stopped when the worker is idle.
The principle of php-fpm
Is a program that implements the fastcgi protocol. After the php.ini was modified, the php-cgi process could not restart smoothly. Php-fpm 's mechanism for dealing with this is that the new worker uses a new configuration, and the existing worker can rest after dealing with the work at hand, through this mechanism to smooth the transition.
This is what the editor shares with you about cgi and the principles of cgi, fastcgi and php-fpm. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.