美文网首页
nginx : 无法将“nginx”项识别为 cmdlet、函数

nginx : 无法将“nginx”项识别为 cmdlet、函数

作者: 冬天我不穿棉袄 | 来源:发表于2019-04-25 18:10 被阅读0次

    输入nginx命令总是出现下面报错

    nginx : 无法将“nginx”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正
        确,然后再试一次。
        所在位置 行:1 字符: 1
        + nginx -s reload
        + ~~~~~
            + CategoryInfo          : ObjectNotFound: (nginx:String) [], CommandNotFoundException
            + FullyQualifiedErrorId : CommandNotFoundException
    
    image.png

    一开始我用的是windows powerShell管理员身份运行的,后来我用cmd运行nginx命令就没有报错了。

    第二个报错:

    nginx: [emerg] "server" directive is not allowed here in D:\nginx-1.15.12/conf/nginx.conf:47
    
    image.png

    自己新增的server写错了位置,{}嵌套的时候弄错了,写在了另一个server里面。修改过来就行了

    相关文章

      网友评论

          本文标题:nginx : 无法将“nginx”项识别为 cmdlet、函数

          本文链接:https://www.haomeiwen.com/subject/lpttnqtx.html