nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

码农世界 2024-06-05 后端 79 次浏览 0个评论

下载完成nginx解压后,CMD窗口中输入nginx报错

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (5: Access is denied)

2024/02/03 23:08:47 [emerg] 64824#59720: CreateDirectory() "D:\test\nginx-1.18.0/temp/client_body_temp" failed (5: Access is denied)

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

异常原因

由于nginx的权限不够无法去创建文件如logs下的error.log文件

解决方法

给予nginx足够的权限

点击鼠标右键打开文件属性

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

 点击安全,点击编辑

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

勾选上赋予的权限,然后点击应用,确定

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

 再次进入CMD窗口输入nginx重新运行,不再报错

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

访问默认端口: localhost:80, 成功访问

nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den

转载请注明来自码农世界,本文标题:《nginx: [alert] could not open error log file: CreateFile() “logs/error.log“ failed (5: Access is den》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,79人围观)参与讨论

还没有评论,来说两句吧...

Top