欢迎光临散文网 会员登陆 & 注册

Apache模块配置:FCGID

2021-04-09 18:40 作者:CSDN首席喷子  | 我要投稿

mod_fcgid是HTTPD的官方FastCGI管理器,能够管理PHP等FastCGI程序的生命周期,复用服务进程以提升性能。使用mod_fcgid时需首先加载该库:

LoadModule fcgid_module mod_fcgid.so

然后对其进行配置:

<IfModule fcgid_module>

FcgidInitialEnv PHPRC "D:/PHP/php74" # 确定php.ini的位置

FcgidMaxRequestsPerProcess 1024 # 每个FCGI进程请求数

FcgidMaxProcesses 4

# 最大FCGI进程数,共计接受4096个请求,超出可能会报503错误


FcgidIOTimeout 180

FcgidIdleTimeout 240

AddType application/x-httpd-php .php

<Files ~ "\.php$">

AddHandler fcgid-script .php

FcgidWrapper "D:/PHP/php74/php-cgi.exe" .php

</Files>

</IfModule>

最后为DocumentRoot添加读取权限:

DocumentRoot "${DOCROOT}"

<Directory "${DOCROOT}">

AllowOverride All

Options +Indexes +ExecCGI

Require all granted

</Directory>

即可使用FastCGI执行PHP程序。


Apache模块配置:FCGID的评论 (共 条)

分享到微博请遵守国家法律