中心思想是在不同的虚拟主机或目录,调用对应版本的PHP以FastCGI模式运行。这当然不影响其中一个版本仍用mod_php方式加载。
以下是php5.2.10(mod_php)与php5.3.3(mod_fcgi)并存案例的 apache 配置文件 httpd.ini片段:
#for php5.2.10
LoadModule php5_module D:/Webserver/php5.2.10/sapi/php5apache2_2.dll
AddType application/x-httpd-php .php
PHPIniDir "D:/Webserver/php5.2.10/"
#for php5.3.3
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC "D:/PHP5.3.3/"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 15
FcgidIOTimeout 120
FcgidIdleTimeout 120
</IfModule>
<Directory "D:/MYOA/webroot/php5">
AddHandler fcgid-script .php
#Path to php-cgi
FcgidWrapper "D:/PHP5.3.3/php-cgi.exe" .php
Options +ExecCGI
AllowOverride None
Order allow,deny
allow from all
</Directory>
http://labs.renren.com/apache-mirror//httpd/binaries/win32/mod_fcgid-2.3.6-win32-x86.zip