linux apache php cgi-wrapper,apache 通过mod_fcgi 模块加载php

一,使用软件的详细版本信息如下:

http://www.linuxidc.com/Linux/2012-02/53418.htm

全部软件下载地址:http://yun.recallg.cn/s/ra8As549mQoJNMD

Apache/2.4.27

Apache FastCGI module(mod_fcgid/2.3.9)

PHP 5.2.17(php-cgi)

php各个版本下载地址:http://museum.php.net/php5/

二,详细的配置步骤:

1,安装mod_fcgid模块

1)Apache 模块下载地址:

http://httpd.apache.org/download.cgi#mod_fcgid

2)从源代码编译安装

[root@cp01-rdqa04-dev121-v-jiazhizhong.epc.baidu.com pay]# APXS=/opt/httpd/bin/apxs ./configure.apxs

[root@cp01-rdqa04-dev121-v-jiazhizhong.epc.baidu.com pay]# make && make install

3)修改apache的httpd.conf,加载mod_fcgid.so模块

LoadModule fcgid_module modules/mod_fcgid.so

4)在httpd.conf文件中添加mod_fcgid模块配置

AddHandler fcgid-script .fcgi .php

# Where to look for the php.ini file?

FcgidInitialEnv PHPRC "/home/users/test/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 "/home/users/v_jiazhizhong/php/bin/php-cgi" .php

# Define the MIME-Type for ".php" files

AddType application/x-httpd-php .php

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

#

# 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 MultiViews Includes ExecCGI

AllowOverride None

Order allow,deny

Allow from all

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# AllowOverride FileInfo AuthConfig Limit

#

AllowOverride All

#

# Controls who can get stuff from this server.

#

Require all granted

5)配置好httpd.conf文件后保存,重启Apache,

9f4b131d501a5aac7b60644d40ffb646.png

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值