至于php的配置,与之前博文中使用apache服务器时一样。

对于nginx的配置,来看看如何修改配置文件:

 #user  nobody;
worker_processes ; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout ; #gzip on; server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; root E:/www; location / {
#root html;
index index.php index.html index.htm;
} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page /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
#
location ~ \.php {
# root html;
fastcgi_pass 127.0.0.1:;
# fastcgi_index index.php;
set $real_script_name $fastcgi_script_name;
set $path_info "";
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$")
{
set $real_script_name $;
set $path_info $;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }

现在nginx在遇到请求php文件会交给 php-cgi 去处理,第66行到第89行是与php相关的配置。

windows下nginx和php环境的配置的更多相关文章

  1. Windows下Nginx Virtual Host多站点配置详解

    Windows下Nginx Virtual Host多站点配置详解 此教程适用于Windows系统已经配置好Nginx+Php+Mysql环境的同学. 如果您还未搭建WNMP环境,请查看 window ...

  2. windows下Nginx反向代理服务器安装与配置

    感谢慕课网Geely老师的讲解,本人将Nginx进行如下的总结. Nginx是一款轻量级的Web服务器,也是一款反向代理服务器,其主要特点:高稳定, 高性能,资源占用少功能丰富,模块化结构 支持热部署 ...

  3. [转载]在Windows下搭建Android开发环境

    http://jingyan.baidu.com/article/bea41d437a41b6b4c51be6c1.html 在Windows下搭建Android开发环境 | 浏览:30780 | 更 ...

  4. Windows下Nginx配置SSL实现Https访问(包含证书生成)

    Vincent.李   Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...

  5. windows下 nginx php 环境搭建

    windows下配置nginx+php环境 刚看到nginx这个词,我很好奇它的读法(engine x),我的直译是“引擎x”,一般引“擎代”表了性能,而“x”大多出现是表示“xtras(额外的效果) ...

  6. 在windows下用eclipse + pydev插件来配置python的开发环境

    在windows下用eclipse + pydev插件来配置python的开发环境 一.安装 python 可以到网上下个Windows版的python,官网为:https://www.python. ...

  7. [转]MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)

    MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)   网上有一篇shangdong_chu网友写的文章介绍如何在Eclipse上配置M ...

  8. 01.1 Windows环境下JDK安装与环境变量配置详细的图文教程

    01.1 Windows环境下JDK安装与环境变量配置详细的图文教程 本节内容:JDK安装与环境变量配置 以下是详细步骤 一.准备工具: 1.JDK JDK 可以到官网下载 http://www.or ...

  9. Windows下nginx配置多台服务器做负载均衡

    Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一个IMAP/POP3/SMTP服务. Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3 ...

随机推荐

  1. Javascript实现提示错误的信息直接出现在输入框后

    可以在输入框后加个<span id="error"></span>,当验证错误时这样处理document.getElementById('error').i ...

  2. Android笔记:真机调试

    参考:android通过USB使用真机调试程序 手机:华为Y511-U00 1.将手机USB调试模式连接到PC(直接用数据线连接到PC一般可以自动切换) 2.连接成功后提示安装驱动,我选择的是自动安装 ...

  3. LightOj1385 - Kingdom Division(数学几何题)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1385 题意:下图中已知面积 a b c 求 d; 如果d的面积不确定,输出-1. 连接 ...

  4. EGO Refresh小总结

    这几天项目做完,有点闲,正好可以用来做做总结. 忘了是哪位博客大牛说:不能因为知识点小.少而不做总结. 那么现在就开始实践一把吧~ 总的来说,EGO有几点需要设置,设置完之后,就能够自如地用了. 1. ...

  5. 在CentOS6.5上安装Tomcat6

    Tomcat安装一向方便,linux的比win的更是这样,基本就是拷贝,类似于win中备受青睐的绿色软件,下面只是记录一下过程. 1.从 http://mirrors.cnnic.cn/apache/ ...

  6. A股中为什么有涨幅超过10%的

    在A股规定涨跌幅10%的正常交易日中,某些股票的涨跌幅却超出或没达到10%的,原因是因为A股的交易中最小的价格“申报单位为0.01元”,就是说某些股票不管什么价格都不会刚刚好是10%,它只能“取最近于 ...

  7. Linux中硬件相关命令

    http://www.cnblogs.com/cchust/p/3354570.html http://www.cnblogs.com/kerrycode/archive/2012/07/06/257 ...

  8. 智能生活 科技无限 CTO VOICE 第二期 智能硬件创新创业专场演讲嘉宾招募

    生活不只有诗和远方,还有当下的痛点和需求 当可穿戴设备.虚拟现实.无人机.机器人进入人们视线甚至生活当中 下一个风口就在智能硬件领域上凸显 那么,创业者如何撕掉智能外衣,设计一款有竞争力的智能硬件? ...

  9. 在虚拟机中安装Ubuntu Server 15.04

    学Linux,上红联! 红联Linux门户|Linux通用技术|Linux发行版技术|Linux企业应用|Linux实验室|红联Linux论坛 Linux系统教程 Linux入门 Linux管理 Li ...

  10. Android中读取短信信息

    Android中读取的短信文件有 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /**  * 所有的短信  */ public static final Strin ...