apache线上php版本5.2.6,要加多版本php7,使用fcgi_mod,将mod_fcgid.so拷贝到apache的modules文件夹中。
注意:apache2.2.0-2.2.8使用mod_fcgid2.2版本
而apache2.2.8以上才可使用mod_fcgid2.3.6版本(或以上)
在httpd.conf配置文件中增加如下内容:
LoadModule php5_module D:/AppServ/php5/php5apache2_2.dll
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule mod_fcgid.c>
FcgidInitialEnv PHPRC "D:/AppServ/php7"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 10000
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 15
FcgidIOTimeout 500
FcgidIdleTimeout 900
</IfModule>
<Directory "D:/webpage/php7">
AddHandler fcgid-script .php
FcgidWrapper "D:/AppServ/php7/php-cgi.exe" .php
Options +ExecCGI
AllowOverride all
Order allow,deny
allow from all
</Directory>
设置域名vhost
<VirtualHost *:80>
DocumentRoot "D:/webpage/php7/test"
ServerName xx.xxx.com
FcgidInitialEnv PHPRC "D:/php7/"
FcgidWrapper "D:/php7/php-cgi.exe" .php
ErrorLog logs/xx.xxx.com-error_log
CustomLog logs/xx.xxx.com-access_log common
</VirtualHost>