This small article is a refresher on Common Gateway Interface (CGI), FastCGI, PHP-FPM, and Nginx operations involving PHP.
What is CGI?
As stated in RFC 3875 (CGI protocol v1.1) designed by the Internet Society (ISOC),
The Common Gateway Interface (CGI) allows an HTTP server and a CGI script to share responsibility for responding to client requests. [...] The server is responsible for managing connection, data transfer, transport, and network issues related to the client request, whereas the CGI script handles the application issues such as data access and document processing.
The way it works is that when a web server such as Apache or Nginx receives a request from a client, it executes the command to the application. The cons of CGI therefore are that a new process is started for each received request, leading to a severely cluttered server.
What is Fast Common Gateway Interface (FastCGI)?
FastCGI is essentially an evolution of CGI and has become the standard. The most essential benefit of using FastCGI over CGI is that unlike CGI, it uses persistent processes that can handle multiple requests. In fact, such requests receive responses within the same connection and additional requests might not need to create separate connections.
PHP and Nginx
The best solution for PHP interacting with Nginx is perhaps the PHP FastCGI Process Manager or PHP-FPM. The main advantage of using PHP-FPM is that it uses less memory and CPU as compared to any other standalone applications. It also daemonizes PHP, thereby turning it into a background process while providing a command-line like script for managing various PHP processes.
Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us big data Hadoop training and certification in Chennai | Hadoop Developer Skillset 2018
ReplyDeleteThis post actually made my day. You can not imagine just how much time I
ReplyDeletehad spent for this info! Thanks!
kajal hot
I Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the Data Science Training in btm experts who helped me a lot to achieve my dreams comes true. Really worth trying
ReplyDelete
ReplyDeleteI have read your blog very useful information to everyone.Thanks for sharing and keep updating more.If you are looking for python course visit our website.
Python Training Institute In Bangalore
I really appreciate your work microsoft azure certification
ReplyDeleteIt was wonerful reading your conent. Thankyou very much. # BOOST Your GOOGLE RANKING.It’s Your Time To Be On #1st Page
ReplyDeleteOur Motive is not just to create links but to get them indexed as will
Increase Domain Authority (DA).We’re on a mission to increase DA PA of your domain
High Quality Backlink Building Service
Boost DA upto 15+ at cheapest
Boost DA upto 25+ at cheapest
Boost DA upto 35+ at cheapest
Boost DA upto 45+ at cheapest
Ago look force behind. Everybody full song light.technology
ReplyDelete