首先要注意下載的apache和fastcgi是32位還是64位相對(duì)應(yīng),這點(diǎn)很重要.
實(shí)驗(yàn)?zāi)康膶?shí)現(xiàn)apache多版本php切換
下載的php為非線程安全(nts)
apache2.4和mod_fcgid2.3.9可以到http://www.tjdsmy.cn/download/ 下載
apache2.2 32位和mod_fcgid2.3.6可以到http://www.tjdsmy.cn:81/apache/mod_fcgid-2.3.6-win32-x86.zip 下載
1.安裝/配置/啟動(dòng) Apache
2.下載mod_fcgid解壓后復(fù)制到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
#實(shí)例最大請(qǐng)求
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
#每個(gè)進(jìn)程的最大請(qǐng)求數(shù)
FcgidMaxRequestsPerProcess 1000
#啟動(dòng)的最大進(jìn)程數(shù)
FcgidMaxProcesses 15
#進(jìn)程超時(shí)時(shí)間
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 www.tjdsmy.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.虛擬主機(jī)中修改php版本路徑就可以切換
