🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 长连接服务 php 要求开启以下函数 ``` `pcntl_signal` `pcntl_signal_dispatch` pcntl_fork` `pcntl_wait` `pcntl_alarm` ``` 在h5聊天,后台管理员消息通知等功能使用到 ```sh php think workerman [ status ] [ server ] [ --d ] ``` linux环境下 ```sh php think workerman start --d ``` windows环境下需要分三步执行 ```sh # 内部通讯服务 php think workerman start channel # h5端聊天服务 php think workerman start chat # 后台管理员通知 php think workerman start admin ``` 参数 - status: 状态 - start: 启动 - stop: 关闭 - restart: 重启 - server: 服务 (windows) - channel: 内部通讯 - chat: h5 - admin: 后台 - --d : 后台执行 ## 修改端口 首先在 **config/workerman.php** 文件中修改对应的端口 - **admin.port** 为后台订单提醒服务端口,默认为20002 - **chat.port** 为 h5聊天服务端口,默认为20003 - 修改后需要重启workerman才能生效 修改 h5中聊天服务端口 - 修改 **utils/index.js** 文件中 const VUE_APP_WS_URL = process.env.VUE_APP_WS_URL || `ws://${location.hostname}:20003`; 配置项,修改20003端口 - 重新打包,可以参考 [这里第三点](http://bbs.crmeb.net/forum.php?mod=viewthread&tid=1103&extra=page%3D1) 修改后台订单提醒服务端口 - 在 **/src/setting.js** 文件中修改6行 - 修改后需要重新打包