Three modes combined with Web server and PHP

Source: Internet
Author: User

CGI (Common Gateway Interface) mode

When a client requests dynamic content from the Web server, the dynamic file needs to be processed by a CGI-initiated stand-alone process, the PHP interpreter. The PHP parser parses the php.ini. xml file, initializes the execution environment, then processes the request, returns the processed results in a CGI-formatted format, and finally exits the process, and the Web server returns the results back to the client. This is basically not the way, because for each dynamic request to start the CGI process, and each time to resolve the php.ini and initialize the execution environment, processing the request after the destruction process, this process greatly reduces the multi-request processing performance

Module Modules mode

In the case of using Apache as a Web server, using the characteristics of Apache, DSO dynamically shared objects, PHP as an Apache module, when the need to interpret PHP files, the use of php_mod to explain the dynamic files, no need to start additional processes, The disadvantage is that the process content is complex

fastcgi mode

due to CGI performance flaws, the new process is created when the request arrives, and the execution environment is initialized every time, so the fastcgi mechanism first, the master process is established, the configuration file is parsed, the execution environment is initialized, and then a number of worker processes are pre-generated, and when the dynamic request arrives, master passes the request to one of the workers and receives the next request immediately. and dynamically adjust the number of worker processes, greatly improving the performance. php5.4 later version of the kernel has integrated php-fpm(Fast PHP module)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6F/48/wKioL1WXZpjiP3zRAAD6qvZIQIc302.jpg "title=" 2015-06-22_10-53-55.png "alt=" Wkiol1wxzpjip3zraad6qvziqic302.jpg "/>



This article is from the "Call Me boxin" blog, so be sure to keep this source http://boxinknown.blog.51cto.com/10435935/1670847

Three modes combined with Web server and PHP

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.