windows 下apache开启FastCGI

1、首先去(http://www.apachelounge.com/download/)下载一个合适的mod_fcgid  文件。

 
 
2、将解压后的文件改为mod_fcgid.dll 并复制到apache的module目录下面。
 
3、打开httpd.conf文件,添加如下内容:
LoadModule fcgid_module modules/mod_fcgid.so  
<IfModule mod_fcgid.c>  
    AddHandler fcgid-script .fcgi .php  
    #php.ini的存放目录  
    FcgidInitialEnv PHPRC "d:/server/confs/php5/"  
    # 设置PHP_FCGI_MAX_REQUESTS大于或等于FcgidMaxRequestsPerProcess,防止php-cgi进程在处理完所有请求前退出  
    FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 500  
    #php-cgi每个进程的最大请求数  
    FcgidMaxRequestsPerProcess 500  
    #php-cgi最大的进程数  
    FcgidMaxProcesses 5  
    #最大执行时间  
    FcgidIOTimeout 120  
    FcgidIdleTimeout 120  
    #php-cgi的路径  
    FcgidWrapper "D:/server/php-5.3.6-nts/php-cgi.exe" .php  
    AddType application/x-httpd-php .php  
</IfModule>

4、重新启动 Apache 即可

如果FcgidWrapper的路径中有空格,要在空格前加

作者:冯亮
         
能力有限,水平一般。如有错误,欢迎指正
原文地址:https://www.cnblogs.com/fengliang/p/8395426.html