Home > Backend Development > PHP Tutorial > Comparison of three configuration methods of PHP under IIS, comparison of three configuration methods of iisphp_PHP tutorial

Comparison of three configuration methods of PHP under IIS, comparison of three configuration methods of iisphp_PHP tutorial

WBOY
Release: 2016-07-13 10:13:26
Original
936 people have browsed it

Comparison of three configuration methods of PHP under IIS, comparison of three configuration methods of iisphp

When configuring PHP under Windows IIS 6.0, there are usually three configuration methods: CGI, ISAPI and FastCGI. All three modes can run successfully under IIS 6.0. Let me talk about the differences and performance of these three configuration methods. difference.

1. CGI (Common Gateway Interface) is generally an executable program, such as an EXE file, and the WEB server each occupies a different process, and generally a CGI program can only handle one user request. In this way, when the number of user requests is very large, it will occupy a large amount of system resources, such as memory, CPU time, etc., resulting in low performance.

2. ISAPI (Internet Server Application Program Interface) is a set of API interfaces for WEB services provided by Microsoft. It can realize all the functions provided by CGI and expand on this basis, such as providing a filter application program interface. ISAPI applications are mostly used in the form of DLL dynamic libraries, which can be executed after being requested by the user. They will not disappear immediately after processing a user request, but will continue to reside in the memory and wait for other user input to be processed. In addition, ISAPI's DLL application and WEB server are in the same process, and the efficiency is significantly higher than CGI.

Configure PHP in ISAPI mode under IIS6 of Windows Server 2003. The configuration method is to add a new WEB service extension in the "WEB Service Extension" of IIS. The program suffix is ​​PHP and the ISAPI program is php5isapi.dll, and then " Add the variable name PHPRC in "Environment Variables" - "System Variables", and the value is the path to php.ini. In the Internet Information Service Manager, select the root directory of the website or application and open the directory property page (right-click and select "Properties") , and then select "Home Directory". Click the "Configure" button and select the "Mapping" tab page. Click "Add...", set the "Executable File" to: c:phpphp5isapi.dll, set the extension to .php, select "Confirm whether the file exists", and then "OK" to save the settings. Restart the server to complete the PHP configuration.

3. FastCGI is an open extension of CGI with a scalable architecture. Its main behavior is to keep the CGI interpreter process in memory and thus obtain higher performance. Repeated loading of traditional CGI interpreters is the main reason for low CGI performance. If the CGI interpreter remains in memory and accepts FastCGI process manager scheduling, it can provide good performance, scalability, etc.

FastCGI has been integrated into IIS7 and also supports IIS6. For the installation method in IIS6, please refer to Microsoft's official documentation. I will briefly translate it here.

First click here to download a 32-bit FastCGI extension for IIS, and then install it. The installed file should be placed in the system32inetsrv directory.

Then open the system32inetsrv directory and execute the following statement, where c:php is your PHP directory and can be modified to other values.

cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"c:phpphp-cgi.exe"

In Internet Information Services Manager, select the root directory of the website or application, open the directory property page (right-click and select "Properties"), and then select "Home Directory". Click the "Configure" button and select the "Mapping" tab page. Click "Add...", set the "Executable File" to: c:windowssystem32inetsrvfcgiext.dll, set the extension to .php, select "Confirm whether the file exists", and then "OK" to save the settings.

Modify the php.ini file and add the following statement:

​fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0

Then open the system32inetsrv directory and execute the following statement:

cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000
cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000

Finally, configure the security of the c:php directory so that the IIS_WPG group has read and execute permissions for this directory.

At this time, PHP based on FastCGI has been successfully configured on IIS6.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/915437.htmlTechArticleComparison of three configuration methods of PHP under IIS, three comparisons of iisphp. To configure PHP under Windows IIS 6.0, there are usually There are three configuration methods: CGI, ISAPI and FastCGI. These three modes can be configured under IIS 6.0...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template