windows2003下 apache 以fastcgi模式运行php 详解
来源:互联网 发布:淘宝一航日本笔假货 编辑:程序博客网 时间:2024/06/15 05:09
这两天一直在研究 apache以fastcgi模式运行php,发现很多网上说的都不够详细和具体,后台到国外网站找了一些资料,才了解到fastcgi 是个人开发出来的,当初是适应apache1.X版本,后台经过大牛们的一些优化终于开发出适合apache2.X版本名字叫做fcgid(其实跟fastcgi一样)。以下是安装配置流程:
1、先下载mod_fcgid.so(下载地址:http://www.apachelounge.com/download/),将mod_fcgid.so 放置apache安装目录的modules文件夹下。
2、在apache的http.conf文件里面添加
LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script .fcgi .php
#Set PHP_FCGI_MAX_REQUESTS to greater than or equal to FcgidMaxRequestsPerProcess
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidMaxRequestsPerProcess 1000
#Maximum number of PHP processes
FcgidMaxProcesses 15
FcgidIOTimeout 120
FcgidIdleTimeout 120
AddType application/x-httpd-php .php
参数可根据实际情况设置
3、虚拟主机配置加入相关配置如下
<VirtualHost 192.168.0.225:81>
#php安装路径
FcgidInitialEnv PHPRC "D:/webserver/php/"
#php-cgi.exe路径
FcgidWrapper "D:/webserver/php/php-cgi.exe" .php
ServerName 192.168.0.225:81
DocumentRoot "E:/www"
</VirtualHost>
<Directory "E:/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
上面 “ExecCGI” 这个是必填,大家不要丢掉了。
4、这里定义了默认对网站根的访问权限。
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
这里需要改成改成
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
该步骤一般很多人都忘记加,因此就会出现 “You don't have permission to access /index.php on this server.” 这样的错误。
好了,所有的配置更改全部完成,重启apache,这个时候你会发现任务管理器里有php-cgi.exe的进程,我大概观察了一下,一般一个进程所耗费的内存是15mb的样子,所以FcgidMaxProcesses 这个参数可以根据服务器内存的大小来进行调整。
- windows2003下 apache 以fastcgi模式运行php 详解
- Windows 下 Apache 1.3 以 FastCGI 模式运行 PHP
- Windows下Apache以FastCGI模式运行PHP
- Windows下Apache以FastCGI模式运行PHP
- linux下php以fastcgi模式运行
- Linux+php在apache上以fastcgi模式运行
- windows 下apache 以fastcgi形式运行php
- windows 下apache 以fastcgi形式运行php
- linux下php以fastcgi模式运行-mod_fcgid,不是mod_fastcgi
- Win2003下IIS以FastCGI模式运行PHP
- 关于apache以fastcgi模式运行php的错误理解纠正
- windows2003 + IIS6.0 环境下以Fastcgi方式配置php 5.3.3
- php-运行模式-ISAPI,fastcgi,CGI,cli,apache
- Apache 配置------FastCGI方式使用PHP(包含:linux下编译安装fmod_fcgid,配置apache以支持FastCGI)
- Windows2003下安装Apache+php+jsp+mysql
- Windows2003下安装Apache+php+jsp+mysql
- windows2003下安装Apache、PHP、MySql
- windows2003单IP下iis与apache共存,asp、php多个网站共同运行
- Firebug CSS开发
- UNIX高级环境编程(第二版)程序运行
- Android Mms专题之:Mms源码结构
- 各种类型转换
- BinaryFormatter序列化实例(一)
- windows2003下 apache 以fastcgi模式运行php 详解
- Android强大的网络视图(WebView)
- YUV格式的解析
- 嵌入视图-----显示单个分类
- BinaryFormatter序列化实例(二)
- oracle pl/sql实例练习
- Android Mms专题之:Mms概览介绍
- sencha chart 1.0如何在chart中动态添加series
- [Android实例] android 应用客户端自动升级