首先从gitee仓库去进行克隆:https://gitee.com/yaclty2/timely_service
来自于白鹄的一个开源项目
-
下载gitee仓库代码
-
需要php7.3版本最佳 7.2以上
-
需要swoole4.3.2版本 太高可能会报错 我是在CentOs 7.6.1810 中运行的
-
还需要安装redis扩展 可以通过宝塔面板进行安装
-
导入sql文件,修改config/databases.php,并搭建好nginx站点
-
在项目根目录运行 mkdir -R 777 runtime
-
在项目根目录运行php think chat start 支持 start | start -d |restart |stop
-
然后浏览器访问 www.xxxx.com/index/kefu/index
-
后台管理密码默认为admin 123456
swoole4.3.2安装教程
新建文件夹
<span style="color:#333333"><code class="language-php">mkdir swoole</code></span>
切入到文件夹中,进行下载安装包
<span style="color:#333333"><code class="language-php">wget http<span style="color:#999999">:</span><span style="color:slategray">//pecl.php.net/get/swoole-4.3.2.tgz</span></code></span>
解压
<span style="color:#333333"><code class="language-php">tar <span style="color:#a67f59">-</span>zxvf swoole<span style="color:#990055">-4.3</span><span style="color:#999999">.</span><span style="color:#990055">2</span><span style="color:#999999">.</span>tgz</code></span>
<span style="color:#333333"><code class="language-php">cd swoole<span style="color:#990055">-4.3</span><span style="color:#999999">.</span><span style="color:#990055">2</span></code></span>
进行如下操作
<span style="color:#333333"><code class="language-php">phpize</code></span>
<span style="color:#333333"><code class="language-php"><span style="color:#999999">.</span><span style="color:#a67f59">/</span>configure</code></span>
<span style="color:#333333"><code class="language-php"><span style="color:#999999">.</span><span style="color:#a67f59">/</span>configure <span style="color:#a67f59">--</span>with<span style="color:#a67f59">-</span>php<span style="color:#a67f59">-</span>config<span style="color:#a67f59">=</span><span style="color:#a67f59">/</span>www<span style="color:#a67f59">/</span>server<span style="color:#a67f59">/</span>php<span style="color:#a67f59">/</span><span style="color:#990055">72</span><span style="color:#a67f59">/</span>bin<span style="color:#a67f59">/</span>php<span style="color:#a67f59">-</span>config</code></span>
<span style="color:#333333"><code class="language-php">make <span style="color:#a67f59">&&</span> make install</code></span>
安装完成
查看php中的扩展
<span style="color:#333333"><code class="language-php">php <span style="color:#a67f59">-</span>m</code></span>
如果其中有swoole表示您已经安装成功
如果php -m查看不到swoole 那就需要手动进行配置
<span style="color:#333333"><code class="language-php"><span style="color:#999999">;</span>extension<span style="color:#a67f59">=</span>swoole<span style="color:#999999">.</span>so
<span style="color:#999999">[</span>swoole<span style="color:#999999">]</span>
extension <span style="color:#a67f59">=</span> <span style="color:#a67f59">/</span>www<span style="color:#a67f59">/</span>server<span style="color:#a67f59">/</span>php<span style="color:#a67f59">/</span><span style="color:#990055">73</span><span style="color:#a67f59">/</span>lib<span style="color:#a67f59">/</span>php<span style="color:#a67f59">/</span>extensions<span style="color:#a67f59">/</span>no<span style="color:#a67f59">-</span>debug<span style="color:#a67f59">-</span>non<span style="color:#a67f59">-</span>zts<span style="color:#990055">-20180731</span><span style="color:#a67f59">/</span>swoole<span style="color:#999999">.</span>so</code></span>
然后重启PHP服务
在项目根目录运行php think chat start 支持 start | start -d |restart |stop
这里需要注意一下 当先版本只能是http协议 不然websocket不兼容 客服端无法登录
下面是我的一个测试地址
客服:http://desc.zhangyange.cn/index/kefu/index.html 账号:aaa 密码:aaa
用户:http://desc.zhangyange.cn/index/index/user?kefu_code=kefu6072d64c20a17