Windows下配置Nginx+php环境

1)php的安装与配置。

直接解压下载好的php包,到D盘wnmp目录(D:\wnmp),这里把解压出来的文件夹重命名成php5。进入文件夹修改php.ini-recommended文件为php.ini,并用Editplus或者Notepad++打开来。找到


extension_dir = "./ext"

更改为


extension_dir = "D:/wnmp/php5/ext"

往下看,再找到


;extension=php_mysql.dll
;extension=php_mysqli.dll

前面指定了php的ext路径后,只要把需要的扩展包前面所对应的“;”去掉,就可以了。

这里打开php_mysql.dll和php_mysqli.dll,让php支持mysql。

当然不要忘掉很重要的一步就是,把php5目录下的libmysql.dll文件复制到C:\Windows目录下,也可以在系统变量里面指定路径,当然这里我选择了更为方便的方法^_^。

到这里,php已经可以支持mysql了。

接下来我们来配置php,让php能够与nginx结合。找到


;cgi.fix_pathinfo=1

我们去掉这里的分号(去掉注释)。


cgi.fix_pathinfo=1

这一步非常重要,这里是php的CGI的设置。

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root D:/wnmp/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

 

 

WordPress + Nginx + Uploads = 413 Request Entity Too Large

What I did discover was by opening Chrome's developer tools and watching the Network tab I could see the file uploads were failing. They were red and had a status code of 413: Request Entity too Large.

 

解决方法:增加一个配置项,在Nginx.conf中,

client_max_body_size 20m;

结果如下:

 

参考

解决NGINX PHP "No input file specified"

Nginx with PHP and MySQL on Windows 7

Setup Nginx and PHP on Windows

WordPress + Nginx + Uploads = 413 Request Entity Too Large

windows下配置nginx+php环境

最新文章

  1. accept_mutex与性能的关系 (nginx)
  2. shell条件判断中-a至-z的含义
  3. 【转载】Understand the serialVersionUID
  4. ulipad源码包配置环境及安装
  5. mysql 把文件中的sql语句导入到mysql中
  6. 【转载】IIS7.5(经典模式)访问静态资源(.css和.js文件)提示:未能执行 URL
  7. Python调用C的SDK出现返回值不符合预期以及Segmentation fault
  8. iconv 文件编码相互转换
  9. 颜色rgb
  10. AOI
  11. android TextView 垂直滚动 用动画实现
  12. java api例子网站
  13. 微信小程序-发送模板消息(C#)
  14. BZOJ_1878_[SDOI2009]HH的项链_莫队
  15. 理解koa-router 路由一般使用
  16. 前端多选插件bootstrap-select的使用
  17. 使用gulp构建一个项目
  18. EChart 猜猜乐
  19. shell脚本6--循环,比较
  20. python -- while循环,格式化输出,运算符,初识编码

热门文章

  1. 高性能JavaScript--数据存储(简要学习笔记二)
  2. python基础操作以及hdfs操作
  3. PHP之封装一些常用的工具类函数
  4. Apworks框架实战(六):使用基于Entity Framework的仓储基础结构
  5. LCM性质 + 组合数 - HDU 5407 CRB and Candies
  6. Kafka无消息丢失配置
  7. 【Java每日一题】20161226
  8. 《连载 | 物联网框架ServerSuperIO教程》- 9. 协议过滤器,解决一包多发、粘包、冗余数据
  9. Qt——组件位置随窗口变化
  10. SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis)【转】