我在 mac os x 上安装了 nginx 服务器。现在我尝试重新启动它并出现以下错误。

Sha*_*aba 2 macos nginx

我尝试通过以下链接在 mac os x 上安装 nginx 服务器,当我尝试重新启动服务器时出现以下错误。

如何在 Mac OS X 上安装 Nginx 网络服务器

sudo nginx -s stop

nginx: [error] invalid PID number "   " in "/usr/local/var/run/nginx.pid"
Run Code Online (Sandbox Code Playgroud)

Ale*_*iak 6

nginx: [error] invalid PID number " " in "/usr/local/var/run/nginx.pid"消息很可能意味着 nginx 未启动。

尝试先通过键入 来启动它nginx

要确保 nginx 已成功启动,请执行ps -ax | grep nginx. 我的机器上的输出:

MacBook-Pro-Aleksej:~ alexey$ nginx
MacBook-Pro-Aleksej:~ alexey$ ps -ax | grep nginx
69982 ??         0:00.00 nginx: master process nginx
69984 ??         0:00.00 nginx: worker process
69995 ttys000    0:00.00 grep nginx
Run Code Online (Sandbox Code Playgroud)