windows安装nginx莫名其妙 CreateFile()权限不够创建问题

报错:

C:\Users\Administrator>nginx
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2021/05/14 20:22:43 [emerg] 2024#11660: CreateFile() "C:\Users\Administrator/conf/nginx.conf" failed (3: The system cannot find the path specified)

C:\Users\Administrator>nginx -s stop
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2021/05/14 20:22:52 [emerg] 2052#12692: CreateFile() "C:\Users\Administrator/conf/nginx.conf" failed (3: The system cannot find the path specified)

莫名其妙不能创建CreateFile()
百度了很久 各种各样的解决方案 都没有解决问题。最后我想既然是不能创建文件,是不是权限的问题?
于是我查看nginx文件的操作权限 果然当前用户下没有写入的权限
windows安装nginx莫名其妙 CreateFile()权限不够创建问题_第1张图片
于是我右键单击nginx文件的属性,选择安全这一栏
windows安装nginx莫名其妙 CreateFile()权限不够创建问题_第2张图片
如上图点击编辑修改当前用户下对此文件的权限,把对文件的写入和修改权限加上。点击确认即可。
windows安装nginx莫名其妙 CreateFile()权限不够创建问题_第3张图片
然后就发现再运行nginx就不报错了。

你可能感兴趣的:(nginx,windows10,CreateFile权限问题)