ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## 长连接服务 php 要求开启以下函数 ~~~ `pcntl_signal` `pcntl_signal_dispatch` pcntl_fork` `pcntl_wait` `pcntl_alarm` ~~~ 在h5聊天,后台管理员消息通知等功能使用到 ~~~ php think workerman [ status ] [ server ] [ --d ] ~~~ linux环境下 ~~~ php think workerman start --d ~~~ windows环境下需要分三步执行 ~~~ # 内部通讯服务 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 修改 h5中聊天服务端口 * 修改**.env.production**文件中**VUE\_APP\_WS\_URL**配置项,格式为:**ws://你的域名:自定义端口(chat.port)** * 重新打包, 修改后台订单提醒服务端口 * 在**/public/system/frame/js/index.js**文件中修改367行