mod_fcgid.so地址链接: http://www.apachelounge.com/
#加载fcgid扩展模块(额外说明,fcgid根据实际apache版本对应,apache2版本测试2.3.6正常)
LoadModule fcgid_module modules/mod_fcgid.so
#添加映射
AddHandler fcgid-script .fcgi .php
# 设置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
#限制最大请求字节 (单位b)
FcgidMaxRequestLen 2097152
#将以php后缀的文件定义类型为application/x-httpd-php
AddType application/x-httpd-php .php
#------这里是默认虚拟主机配置(全局默认使用的PHP版本配置)
#php.ini的存放目录
FcgidInitialEnv PHPRC "C:/wamp/bin/php/php5.6.40/"
#php-cgi的路径
FcgidWrapper "C:/wamp/bin/php/php5.6.40/php-cgi.exe" .php
VirtualHost *:80
ServerName www.xx.com
DocumentRoot "G:\sources\weiqing"
FcgidInitialEnv PHPRC "E:/wamp64/bin/php/php7.0.33/"
FcgidWrapper "E:/wamp64/bin/php/php7.0.33/php-cgi.exe" .php
Directory "G:\sources\weiqing"
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
/Directory
/VirtualHost
VirtualHost *:443
DocumentRoot "C:/wamp/www/wq"
ServerName wq.yuntuoit.com
SSLEngine on
SSLCertificateFile "C:/wamp/bin/apache/apache2.4.37/conf/certs/3647413_wq.yuntuoit.com_public.crt"
SSLCertificateKeyFile "C:/wamp/bin/apache/apache2.4.37/conf/certs/3647413_wq.yuntuoit.com.key"
SSLCertificateChainFile "C:/wamp/bin/apache/apache2.4.37/conf/certs/3647413_wq.yuntuoit.com_chain.crt"
FcgidInitialEnv PHPRC "c:/wamp/bin/php/php7.0.33/"
AddHandler fcgid-script .php
FcgidWrapper "c:/wamp/bin/php/php7.0.33/php-cgi.exe" .php
Directory "C:/wamp/www/wq"
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php index.html
/Directory
/VirtualHost
————————————————
参考文章:https://blog.csdn.net/yaozhiwei1019/article/details/105069811
另附linux下操作指引: http://lyk.01city.cn/article/3210.html