mac的端口被占用

1. 查看端口号

 sudo lsof -i:80
COMMAND  PID   USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
httpd    955   root    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd    959 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd    960 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd    961 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd    962 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1291 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1295 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1296 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1322 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1323 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)
httpd   1324 daemon    9u  IPv6 0xf133408b3ad7dd3      0t0  TCP *:http (LISTEN)

2. 查杀对应的端口号

sudo kill 955

3. 进入到tp6的目录

 php think run -p 80 

1 Development server is started On <http://0.0.0.0:80/>
2 You can exit with `CTRL-C`
3 Document root is: /Applications/XAMPP/xamppfiles/htdocs/tp6/public
/** 燕十八 公益PHP培训 课堂地址:YY频道88354001 学习社区:www.zixue.it **/
原文地址:https://www.cnblogs.com/lgs198712/p/15704459.html