登录  /  注册
win8.1下vs2013编译nginx
php中文网
发布: 2016-08-08 09:31:47
原创
744人浏览过

我的环境是win8.1 + vs2013社区版

1、安装msys。

http://sourceforge.net/projects/mingw/files/ Installer文件夹下有mingw-get,安装之后,弹出的界面中选择msys即可安装msys。

2、下载 zlib、openssl和pcre

下的几个版本为:openssl-1.0.1j、pcre-8.32、zlib-1.2.8

解压到 $(NGINX_SOURCE)\objs\lib 目录,这个$(NGINX_SOURCE)为nginx源码放置路径,例如D:\Tools\nginx。

3、生成makefile

a) 启动vs 2013命令行。 通过vs 2013工具命令行启动msys,能省略配置cl路径的步骤。

b) 在上述命令行中启动msys。

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd /d C:\MinGW\msys\1.0

C:\MinGW\msys\1.0>msys.bat
登录后复制
c) 在msys控制台窗口中,运行配置脚本

$ cd /d/Tools/nginx/

$ auto/configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.32 --with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1j --with-select_module --with-http_ssl_module --with-ipv6
登录后复制

如果不想下载zlib(gzip模块需要)、pcre(rewrite模块需要)和openssl,可以修改一下configure命令行

$ auto/configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-select_module --without-http_rewrite_module --without-http_gzip_module
登录后复制

4、启动编译。

在编译之前,需要修改一下makefile,去掉CFLAGS中的-WX编译选项,否则vs2013会把警告当错误终止编译。

cd D:\Tools\nginx\
nmake -f objs\Makefile
登录后复制

5、运行nginx。

a) 把objs\nginx.exe拷贝到上一级目录。

b) 创建文件夹logs、temp

c) 启动nginx.exe

以上就介绍了win8.1下vs2013编译nginx,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 技术文章
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1

 | 本站CDN由 数掘科技 提供

登录PHP中文网,和优秀的人一起学习!
全站2000+教程免费学