问题描述
我现在已经尝试了大多数事情,所以我很想寻求帮助。我试图重新安装laravel valet。我也试过重新安装 brew,但我一直收到同样的错误。
当我运行 brew services list
时,我得到:
▶ brew services list
Name Status User Plist
dnsmasq unknown root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
nginx error root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
如您所见,nginx 出现错误。当我运行 sudo /usr/local/opt/nginx/bin/nginx -g 'daemon off;'
时,我得到以下输出:
nginx: [emerg] bind() to 127.0.0.1:80 failed (48: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (48: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (48: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (48: Address already in use)
nginx: [emerg] bind() to 127.0.0.1:80 failed (48: Address already in use)
nginx: [emerg] still could not bind()
所以看起来有另一个 nginx 进程以某种方式启动了?当我运行 sudo lsof -i tcp:80
时,我得到了这个:
▶ sudo lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 71557 root 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71558 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71559 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71560 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71561 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71562 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71563 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71564 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71565 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71567 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71568 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71569 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
nginx 71571 margul 6u IPv4 0xb2e487bcf1edb7ad 0t0 TCP localhost:http (LISTEN)
如果我在做 ps aux | grep "nginx"
,我会得到这个:
▶ ps aux | grep "nginx"
margul 71571 0,0 0,0 4319864 1352 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71569 0,0 4314744 1368 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71568 0,0 4333176 1420 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71567 0,0 4313720 1340 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71565 0,0 4315768 1408 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71564 0,0 4325252 2024 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71563 0,0 4331128 1396 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71562 0,0 4331128 1360 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71561 0,0 4313720 1372 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71560 0,0 4321912 1388 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71559 0,0 4330104 1380 ?? S 11:21pm 0:00.00 nginx: worker process
margul 71558 0,0 4320888 1408 ?? S 11:21pm 0:00.00 nginx: worker process
root 71557 0,0 4293560 612 ?? Ss 11:21pm 0:00.00 nginx: master process nginx
margul 97215 0,0 4277664 752 s001 R+ 12:11am 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox nginx
我已经没有什么可以尝试的了,我即将重新安装 MacOS,这只是为了让 Laravel 代客工作而疯狂。就像我说的,我曾多次尝试以各种不同的方式卸载 Laravel valet,重新启动,停止 nginx 服务,卸载 brew。
如果有人能指出我正确的方向,那就太棒了。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)