apache2.4以FastCGI的方式连接PHP5的配置

软件版本:

apache:httpd-2.4.10-x86-vc11-r2

PHP:PHP 5.5.21(php-5.5.21-nts-Win32-VC11-x86.zip,因为是FastCGI方式,所以选择非线程安全版本,一般apache配合PHP是把PHP当作一个模块运行了,这种情况使用线程安全版本

1、下载apache2.4的fastCGI的模块

下载地址:http://www.apachelounge.com/download/

选择对应的版本:modules-2.4-win32-VC11.zip (因为我这里的)

这里面除了FahstCGI模块等好几个模块,我们需要的是 mod_fcgid.so

2、把mod_fcgid.so放到apache2.4的modules目录下;

3.修改apache的httpd.conf,添加加载mod_fcgid.so模块的配置

LoadModule fcgid_module modules/mod_fcgid.so

4.添加httpd.conf的mod_fcgid的模块配置

<IfModule mod_fcgid.c>AddHandler fcgid-script .fcgi .php
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC        "c:/php"
# Set PHP_FCGI_MAX_REQUESTS to greater than or equal to FcgidMaxRequestsPerProcess
# to prevent php-cgi process from exiting before all requests completed
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS      1000
# Maximum requests a process should handle before it is terminated
FcgidMaxRequestsPerProcess       1000
# Maximum number of PHP processes
FcgidMaxProcesses             15
# Number of seconds of idle time before a php-cgi process is terminated
FcgidIOTimeout             120
FcgidIdleTimeout                120
#Path to php-cgi
FcgidWrapper "c:/php/php-cgi.exe" .php
# Define the MIME-Type for ".php" files
AddType application/x-httpd-php .php</IfModule>

5.修改httpd.conf中的, Options Indexes FollowSymLinks后面添加Includes ExecCGI。修改后如下:

<Directory "E:/webroot">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks  Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted</Directory>



转载于:https://my.oschina.net/yck108/blog/373022

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值