IIS下PHP的三種配置方式比較,iisphp三種配置
Jun 13, 2016 am 09:21 AMIIS下PHP的三種配置方式比較,iisphp三種配置
在Windows IIS 6.0下配置PHP,通常有CGI、ISAPI和FastCGI三種配置方式,這三種模式都可以在IIS 6.0下成功運行,下面我就講一下這三種方式配置的區(qū)別和性能上的差異。
1、CGI(通用網(wǎng)關(guān)接口/Common Gateway Interface)一般是可執(zhí)行程序,例如EXE文件,和WEB服務(wù)器各自占據(jù)著不同的進程,而且一般一個CGI程序只能處理一個用戶請求。這樣,當用戶請求數(shù)量非常多時,會大量占用系統(tǒng)的資源,如內(nèi)存、CPU時間等,造成效能低下。
2、ISAPI(Internet Server Application Program Interface)是微軟提供的一套面向WEB服務(wù)的API接口,它能實現(xiàn)CGI提供的全部功能,并在此基礎(chǔ)上進行了擴展,如提供了過濾器應(yīng)用程序接口。ISAPI應(yīng)用大多數(shù)以DLL動態(tài)庫的形式使用,可以在被用戶請求后執(zhí)行,,在處理完一個用戶請求后不會馬上消失,而是繼續(xù)駐留在內(nèi)存中等待處理別的用戶輸入。此外,ISAPI的DLL應(yīng)用程序和WEB服務(wù)器處于同一個進程中,效率要顯著高于CGI。
在Windows Server 2003的IIS6下配置ISAPI方式的PHP,配置方法是,在IIS的“WEB服務(wù)擴展”中,添加一個新的WEB服務(wù)擴展,程序后綴為PHP,ISAPI程序為php5isapi.dll,然后再“環(huán)境變量”-“系統(tǒng)變量”中增加變量名PHPRC,數(shù)值為php.ini的路徑,在Internet信息服務(wù)管理器中,選擇網(wǎng)站或應(yīng)用程序的根目錄,打開目錄屬性頁(右鍵選擇“屬性”),再選擇“主目錄”。點擊“配置”按鈕,選擇“映射”Tab頁。點擊“添加...”,在“可執(zhí)行文件”設(shè)為: c:\php\php5isapi.dll,擴展名設(shè)為.php,選擇“確認文件是否存在”,然后“確定”保存設(shè)置。重啟服務(wù)器即可完成PHP的配置。
3、FastCGI是可伸縮架構(gòu)的CGI開放擴展,其主要行為是將CGI解釋器進程保持在內(nèi)存中并因此獲得較高的性能。傳統(tǒng)的CGI解釋器的反復加載是CGI性能低下的主要原因,如果CGI解釋器保持在內(nèi)存中并接受FastCGI進程管理器調(diào)度,則可以提供良好的性能、伸縮性等。
FastCGI已經(jīng)集成于IIS7,也支持IIS6,在IIS6中的安裝方法可參見微軟的官方文檔,我這里簡單翻譯一下。
先點這里下載一個32位的FastCGI extension for IIS,然后將其安裝,安裝后的文件應(yīng)該放到system32\inetsrv目錄下。
之后打開system32\inetsrv目錄,執(zhí)行下面的語句,其中c:\php為你的PHP目錄,可以修改為其他數(shù)值。
cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"c:\php\php-cgi.exe"
在Internet信息服務(wù)管理器中,選擇網(wǎng)站或應(yīng)用程序的根目錄,打開目錄屬性頁(右鍵選擇“屬性”),再選擇“主目錄”。點擊“配置”按鈕,選擇“映射”Tab頁。點擊“添加...”,在“可執(zhí)行文件”設(shè)為: c:\windows\system32\inetsrv\fcgiext.dll,擴展名設(shè)為.php,選擇“確認文件是否存在”,然后“確定”保存設(shè)置。
修改php.ini文件,增加如下語句:
fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
之后打開system32\inetsrv目錄,執(zhí)行以下語句:
cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000
cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000
最后,配置c:\php目錄的安全性,使得IIS_WPG組對于這個目錄有讀取和執(zhí)行的權(quán)限。
這時候,基于FastCGI的PHP就成功配置到IIS6上了。

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

To open an application pool in IIS: 1. Open IIS Manager; 2. Navigate to the "Application Pools" node; 3. Right-click the target application pool and select "Manage"; 4. Click "Advanced Settings" Tab; 5. Application pool configuration can be viewed and modified here.

Yes, it is possible to delete IIS log files. Removal methods include selecting the website or application pool through IIS Manager and deleting the log file in the Log Files tab. Use a command prompt to go to the log file storage directory (usually %SystemRoot%\System32\LogFiles\W3SVC1) and use the del command to delete the log file. Use third-party tools such as Log Parser to automatically delete log files.

Solutions to iis failure to start: 1. Check the integrity of the system files; 2. Check the port occupancy; 3. Start related services; 4. Reset the IIS configuration; 5. Reinstall IIS; 6. Check the event viewer log; 7 , Regular maintenance and updates; 8. Back up important data. Detailed introduction: 1. Check the integrity of the system files, run the system file checking tool, check the integrity of the system files, if you find problems with the system files, you can try to repair or replace the damaged files; 2. Check the port occupancy, in Windows Command prompt method.

IIS Manager can be opened through Control Panel, Command Prompt, or Run window. Once opened, it contains detailed information and configuration settings about the web server, organized into: Server, Site, Application Pool, Feature View, and Common Tasks.

To set up the IIS protocol, follow these steps: Open IIS Manager, select the website. In the Actions panel, click Bind. Add the protocol to use (HTTP or HTTPS), specify the IP address and port. For HTTPS, configure the SSL certificate, select the certificate type and certificate. Save the changes and test the binding.

The IIS Application Pool Setup Guide provides detailed instructions for configuring application pools directly in IIS Manager: application name, mode, launch type managed mode, authentication, loading user profile 32-bit application enablement, recycling frequency and reason Application path, hosting mode, initial memory allocation virtual directory, initialization module, fault isolation mode

Author | Editor Chen Xupeng | ScienceAI Aphasia due to defects in the nervous system can lead to serious life disabilities, and it may limit people's professional and social lives. In recent years, the rapid development of deep learning and brain-computer interface (BCI) technology has provided the feasibility of developing neurospeech prostheses that can help aphasic people communicate. However, speech decoding of neural signals faces challenges. Recently, researchers from VideoLab and FlinkerLab at the University of Jordan have developed a new type of differentiable speech synthesizer that can use a lightweight convolutional neural network to encode speech into a series of interpretable speech parameters (such as pitch, loudness, formant frequency, etc.), and synthesize these parameters into speech through a differentiable neural network. this synthesizer
