首先要注意下載的apache和fastcgi是32位還是64位相對應,這點很重要.
實驗目的實現(xiàn)apache多版本php切換
下載的php為非線程安全(nts)
apache2.4和mod_fcgid2.3.9可以到http://lncdfzh.com.cn/download/ 下載
apache2.2 32位和mod_fcgid2.3.6可以到http://lncdfzh.com.cn:81/apache/mod_fcgid-2.3.6-win32-x86.zip 下載
1.安裝/配置/啟動 Apache
2.下載mod_fcgid解壓后復制到apache/modules
3.httpd.conf
Include conf/extra/php.conf
Include conf/extra/httpd-vhosts.conf

4.添加php.conf 內(nèi)容如下
#加載mod_fcgid
LoadModule fcgid_module modules/mod_fcgid.so
#設(shè)置apache如何處理php文件
AddHandler fcgid-script .fcgi .php
#實例最大請求
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
#每個進程的最大請求數(shù)
FcgidMaxRequestsPerProcess 1000
#啟動的最大進程數(shù)
FcgidMaxProcesses 15
#進程超時時間
FcgidIOTimeout 120
FcgidIdleTimeout 120
#添加mime支持php
AddType application/x-httpd-php .php
5.建站
1).添加php路徑
FcgidInitialEnv PHPRC "C:/php/5.3"
FcgidWrapper "C:/php/5.3/php-cgi.exe" .php
2).Options FollowSymLinks 后面添加 ExecCGI
如下:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.cc.com
DocumentRoot "D:/wwwroot/cc.com"
ServerName cc.com
ServerAlias lncdfzh.com.cn
ErrorLog "logs/cc.com-error.log"
CustomLog "logs/cc.com-access.log" common
FcgidInitialEnv PHPRC "C:/php/5.3"
FcgidWrapper "C:/php/5.3/php-cgi.exe" .php
<Directory d:/wwwroot/cc.com>
Options FollowSymLinks ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
6.虛擬主機中修改php版本路徑就可以切換
