ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# :-: # 推送服务配置 目前客服插件功能以及收银台语音提醒功能需要开启推送服务。 ### **1.运行环境要求** 1. 语言环境PHP7.1及以上(建议使用7.2) 2. 删除禁用函数 请在php配置里,解除禁用以下函数 pcntl\_signal\_dispatch pcntl\_wait pcntl\_alarm pcntl\_signal pcntl\_fork ![](https://img.kancloud.cn/49/85/4985007058d6ebbecf55df39fb8de83e_1920x911.png) ### **2.配置文件修改** 文件路径:config/gateway.php 1.单个站点只需要修改数据库配置即可 ![](https://img.kancloud.cn/26/06/2606413c32ed8d06acf1c70bb4a3ea47_1461x914.png) 2.同一服务器多个站点除了修改数据库配置以外还需要修改以下四个参数 ![](https://img.kancloud.cn/10/c0/10c0a2dbaa2cc6bc0eb0c5ac3e22086b_1454x908.png) ### **3.服务器配置** ##### **nginx服务器配置** 在虚拟主机配置中加入如下配置 ``` location /wss { #代理到下面的地址去,格式:http://127.0.0.1:端口号 #端口号对应配置文件中的$gateway_port    proxy_pass http://127.0.0.1:8283;     proxy_http_version 1.1;    proxy_set_header Upgrade $http_upgrade;    proxy_set_header Connection "Upgrade"; } ``` ![](https://img.kancloud.cn/b3/4c/b34c2dd2128df6a9281b75e909bd6644_873x786.png) ##### **apache服务器配置** 在httpd.conf文件中,启用 proxy\_wstunnel\_module 模块 ``` LoadModule proxy\_module modules/mod\_proxy.so LoadModule proxy\_wstunnel\_module modules/mod\_proxy\_wstunnel.so ``` 在ssl.conf文件中,配置SSL及代理 ``` #WSS ProxyRequests Off ProxyPass /wss ws://127.0.0.1:8283 #http://127.0.0.1:端口号 ProxyPassReverse /wss wss://127.0.0.1/wss #客户端的域名 ``` ![](https://img.kancloud.cn/51/9d/519daf35638f7fd1ce864a76e7d024ca_1217x902.png) ### **4.启动服务** ##### **Linux系统** 将 [PHP路径] 和 [项目路径] 替换为实际目录路径 开启服务 ``[PHP路径]/bin/php [项目路径]/app/gateway/start.php start -d`` ``例:/www/server/php/72/bin/php /www/wwwroot/v5.niuteam.cn/app/gateway/start.php start -d`` 停止服务 ``[PHP路径]/bin/php [项目路径]/app/gateway/start.php stop`` ``例:/www/server/php/72/bin/php /www/wwwroot/v5.niuteam.cn/app/gateway/start.php stop`` 服务状态 ``[PHP路径]/bin/php [项目路径]/app/gateway/start.php status`` ``例:/www/server/php/72/bin/php /www/wwwroot/v5.niuteam.cn/app/gateway/start.php status`` ![](https://img.kancloud.cn/12/7f/127f0b768e0c1b8d2bb75ce98cd14c3d_836x578.png) ##### **Windows系统** 开启服务 找到 app\gateway\start_for_win.bat 双击启动服务 如果要停止服务,点击命令行窗口,ctrl + c 然后看到提示后输入y,回车确定就可以关闭 ![](https://img.kancloud.cn/89/b7/89b7e8b2beb8432dcf6aa3ea5d302021_753x293.png) ![](https://img.kancloud.cn/01/ee/01eef770df063c43dfeb76a53988c83f_993x519.png)