运行nginx失败,有同样是windows系统的吗帮忙看一下,

来源:1-2 课程学习指南

慕鱼树

2019-03-12

终端命令行会报错

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


Suggestion [3,General]: 找不到命令 nginx,但它确实存在于当前位置。默认情况下,Windows PowerShell 不会从当前位置加载命令 。如果信任此命令,请改为键入“.\nginx”。有关详细信息,请参阅 "get-help about_Command_Precedence"。
PS D:\nginx>输入代码

nginx.config文件里将端口改为了9000,也没法用localhost:9000打开网页

server {
        listen  9000;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }
写回答

1回答

Sam

2019-03-12

下一个windows版本的终端试试,另外,nginx服务能正常启动吗?

0
3
Sam
回复
慕鱼树
好的,不客气
2019-03-13
共3条回复

Vue 实战商业级读书Web APP完整项目

Vue全家桶+最新前端技术+前后端分离架构,完整项目流程

1623 学习 · 1951 问题

查看课程