thinkPHP6报错:Failed to listen on 0.0.0.0:8000 (reason: һַȨ޲
2022-11-24 11:10:29
174
{{single.collect_count}}

1、在命令行执行命令”php think run“时,回车后,反馈显示
ThinkPHP Development server is started On http://127.0.0.1:8080/
You can exit with CTRL-C
Document root is: D:\php\thinkPHP_6\public
[Sun Jan 10 21:51:54 2021]] Failed to listen on 0.0.0.0:8000 (reason: һַȨ޲

2、此时,说明tp6默认是使用8000端口,但我本机的8000端口被其它进程占用了,我们可以修改tp6的访问端口,执行如下命令,将端口改为8080或者其他的未被占用的端口:

php think run -p 8080

3、命令执行后返回如下内容,就说明端口修改成功,此时再打开浏览器输入"http:/localhost:8080,就能正常访问tp6的页面了
ThinkPHP Development server is started On http://127.0.0.1:8080/
You can exit with CTRL-C
Document root is: D:\php\thinkPHP_6\public
[Sun Jan 10 21:59:57 2021]] 127.0.0.1:63685 [200]: /
[Sun Jan 10 22:01:14 2021] 127.0.0.1:63691 [200]: /favicon.ico

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}