WampServer中Apache使用FastCGI模式跑PHP5.3nts版

要用到一套使用了 Zend Guard 加密PHP系統,且運行環境是 PHP5.3,因此須要使用 Zend Guard Loader 擴展。php

Zend Guard Loader 擴展 Win 版只支持運行在 PHP5.3 以上的 nts 版上,但 Window 版的 Apache 貌似已經不支持nts版的PHP了,蛋疼。
shell

我用的是WampServer集成環境,因而就想到了把 Apache 換成 FastCGI 模式來跑 PHP5.3 nts 版,這樣就能夠使用Zend Guard Loader 擴展了。apache


一、下載 PHP5.3.28 ,解壓到 F:/php5.3.28nts ,配置好 php.ini,也順便把 Zend Guard Loader 擴展配置好。windows

二、下載 mod_fcgid-2.3.6-win32-x86.zip 解壓 manual、modules 目錄中的文件到 f:\wamp\bin\apache\apache2.2.22 對應目錄裏去。
app

三、打開 Apache 配置文件 F:\wamp\bin\apache\apache2.2.22\conf\httpd.conf ,用#號註釋掉 LoadModule php5_module "F:/wamp/bin/php/php5.3.13/php5apache2_2.dll" ,並在下面一行加入 :ide

LoadModule fcgid_module modules/mod_fcgid.so

四、在 httpd.conf 配置文件的最後加入下面的配置:
加密

AddHandler fcgid-script .fcgi .php
#php.ini的存放目錄
FcgidInitialEnv PHPRC "F:/php5.3.28nts"
# 設置PHP_FCGI_MAX_REQUESTS大於或等於FcgidMaxRequestsPerProcess,防止php-cgi進程在處理完全部請求前退出
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
#php-cgi每一個進程的最大請求數
FcgidMaxRequestsPerProcess 1000
#php-cgi最大的進程數
FcgidMaxProcesses 3
#最大執行時間
FcgidIOTimeout 120
FcgidIdleTimeout 120
#php-cgi的路徑
FcgidWrapper "F:/php5.3.28nts/php-cgi.exe" .php
AddType application/x-httpd-php .php

五、告訴 Apache 執行方式,修改配置以下:.net

<Directory 「D:/Web」>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

六、最後重啓 Apache。code


相關文章
相關標籤/搜索