Nginx is the server
What is a server?
For example: Iis,apache,nginx ... The main is to provide web browsing services, the application layer using the HTTP protocol.
cgi,fastcgi
The CGI name is a "public Gateway Interface" (Common Gateway Interface), a tool that the HTTP server "chats" with programs on your or other machines, and its programs must be run on a network server.
Php
PHP belongs to a server-side scripting language
Three relations:
The server can resolve the HTTP protocol, and the server receives a request and returns a response, such as an HTML page. The server receives the request, the parse file encounters the HTML file, the picture can respond directly, and the PHP file is sent to
cgi,cgi send the file to PHP parsing, and PHP will return to the server via CGI. CGI plays a role of communication bridge.
Of course, Nginx and PHP have another way to link UNIX sockets
Note: The text only represents the individual to understand the point of view if there are errors welcome to discuss
Php,cgi,nginx relationship