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文件的操作权限 果然当前用户下没有写入的权限
在这里插入图片描述
于是我右键单击nginx文件的属性,选择安全这一栏
如
如上图点击编辑修改当前用户下对此文件的权限,把对文件的写入和修改权限加上。点击确认即可。
在这里插入图片描述
然后就发现再运行nginx就不报错了。

  • 7
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值