Nginx+PHP On windows

时间:2022-03-02 02:31:47

前期准备

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