Nginx启动失败,80端口被占用,kill不掉进程

2023-12-13 05:26:23

启动 nginx 就会报错,提示80端口被占用

nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) 
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use) 
nginx: [emerg] still could not bind()

试了无数种方法,找进程,kill进程,网络监视器找进程,都没有成功。?

最终解决办法

lsof -iTCP -sTCP:LISTEN -P | grep :80

找到哪个进程监听的 80 端口?

没有 lsof 的话先安装lsof

brew install lsof

最后kill 进程

sudo kill? PID?

文章来源:https://blog.csdn.net/zhaojjjjjj163/article/details/134804834
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。