Nginx+PHP On windows

前期准备

Nginx 下载

http://nginx.org/

 

PHP下载

PHP Windows binaries

 

 

 

问题

问题1:

opened a DOS window to launch the nignx server, and got the following errors:
D:\Users\phil>c:\nginx\nginx.exe
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: FormatMessage() error:(15100))
2014/04/03 11:30:01 [emerg] 2356#6140: CreateFile() "D:\Users\phil/conf/nginx.conf" failed (3: FormatMessage() error:(15105))
D:\Users\phil>

问题解决:

显然是默认相对路径不认,去修改nginx.conf文件,调整access_log的路径地址,如下;

或者

在windows下启动nginx要在命令行里进入nginx.exe的那个目录里,否则会提示不能创建日志文件(不能简单的改写环境变量)

 

参考

如何正确配置Nginx+PHP

nginx + PHP on Windows in 5 minutes

posted @ 2015-11-12 10:14  霍旭东  阅读(638)  评论(0编辑  收藏  举报