The structure of php is like the network server receives a request and then calls the php program to process the php script, which is similar to the nature of cgi, but why, many people regard cgi as an outdated technology, or think of php as a completely different structure from cgi? Are there any essential differences between them? The structure of php is like the network server receives a request and then calls the php program to process the php script, which is similar to the nature of cgi, but why, many people regard cgi as an outdated technology, or think of php as a completely different structure from cgi?
Are there any essential differences between them? Reply content: first, CGI is the interface standard between external applications and Web servers. Programs Written in different types of languages must comply with cgi standards, as a cgi program, most of the early cgi programs were c or c ++. Php can be used as a cgi. When it is used as a cgi, it runs as an independent process and creates a process to respond to it upon request. When php is used as a module of apache, php will exist as a sub-process of apache and be called by apache. Now we also have a php-fpm + nginx combination. php-fpm is a fast-cgi manager responsible for allocating received requests to pre-generated php subprograms, manages php processes.
PHP (Hypertext Preprocessor, Hyper Text Preprocessor)It is a programming language mainly used for server-side dynamic page generation and database operations. CGI is one of its many applications.
CGI (Common Gateway Interface) is a Common technology. For example, after I answer this question and click Submit, the text is passed to the CGI program on zhihu's server by the browser. After processing, someone else can open this page to see my answer.
CGI can be implemented in many languages on the server, such as PHP, Python, C/C ++, and JAVA.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service