# 简陋聊天室 **Repository Path**: eeezra/chat_room ## Basic Information - **Project Name**: 简陋聊天室 - **Description**: swoole练习作品 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-06-04 - **Last Updated**: 2023-05-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: Swoole, Laravel ## README ## 简陋聊天室 ### 登陆页面 ![登录页面](./public/img/chat_login.png) ### 主页面 ![主页面](./public/img/chat_index.png) ### 聊天页 ![聊天页](./public/img/chat_room.png) #### 进入项目目录启动服务 ``` 命令:php artisan swoole:server ``` 此状态下linux页面ctrl+c即可结束进程 #### 开启守护进程 在app\Console\Commands\SwooleServer.php文件里将下面这行注释解开 ```php $server->set(array( // 'daemonize'=>true //后台运行 )); ``` #### 守护进程下关闭进程 ##### 查看端口号 ``` netstat -tunlp | grep 端口号 ``` ``` netstat -ntlp //查看当前所有tcp端口 netstat -ntulp | grep 80 //查看所有80端口使用情况 netstat -ntulp | grep 3306 //查看所有3306端口使用情况 ``` ##### kill pid ![杀掉进程](./public/img/kill.png) ``` kill -9 PID ``` 如上图,我们看到 9502 端口对应的 PID 为 6384,使用以下命令杀死进程(9502是swoole的进程具体看你定义的端口是哪个): ``` kill -9 9384 ```