找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 909|回复: 2

window下nginx+php配置安装篇

[复制链接]
发表于 2011-10-10 08:25:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
<div id="blog_text" class="cnt" >
Nginx (&quot;engine x&quot;) 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。尽管还是测试版,但是,Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。


nginx下载地址: 下载nginx for Windows 版本

php下载地址: 下载php for Windiowns版本

第二,解压下载好的nginx压缩包(假如放到到了C:\WWW\SERVER\nginx-0.8.24),然后以Fastcgi 模式安装php C:\WWW\SERVER\php5,接下来就是nginx 配置啦,打开nginx-0.8.24下的conf文件下的nginx.conf

下面这写代码内容就是我的nginx 配置单:

[table=80%]

  • server {
  •         listen       4000;                       //web端口号,我在本地测试用4000这个端口
  •         server_name localhost;        #charset koi8-r;        #access_log logs/host.access.log main;        location / {
  •             root   html;
  •             index index.html index.htm index.php;
  •         }        #error_page 404              /404.html;        # redirect server error pages to the static page /50x.html
  •         #
  •         error_page   500 502 503 504 /50x.html;
  •         location = /50x.html {
  •             root   html;
  •         }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  •         #
  •         #location ~ \.php$ {
  •         #    proxy_pass   http://127.0.0.1;
  •         #}       pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000       //开启这一段,因为nginx本身不支持php,需用用FastCGI模式支持php
  •         
  •         location ~ \.php$ {
  •             root           html;
  •             fastcgi_pass   127.0.0.1:9000;
  •             fastcgi_index index.php;
  •             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      //修改web目录,默认为nginx下的html文件夹
  •             include        fastcgi_params;
  •         }        # deny access to .htaccess files, if Apache's document root
  •         # concurs with nginx's one
  •         #

发表于 2011-10-10 23:47:13 | 显示全部楼层
顶.支持,路过!












发表于 2011-10-14 11:28:01 | 显示全部楼层
真不错,赞一个,继续努力啊













您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

返回顶部快速回复上一主题下一主题返回列表找客服手机访问

QQ|申请友链|Archiver|小黑屋|手机版|网站地图|谷姐论坛 谷姐提供 ( 渝ICP备2021009247号-1 )

GMT+8, 2024-6-2 21:52

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表