人人商城互动直播配置(公众号)

 

针对已安装宝塔面板的Linux服务器

基础环境

1、PHP(建议使用5.6以上版本)、

2、服务器放行9501、6379端口

3、在当前php版本中安装插件Redis、Swoole

必须安装组件支持

Redis、Swoole

 

修改配置文件

Redis配置

wwwroot/www.demo.com/data/config.php

1. 修改$config['setting']['cache'] = 'mysql';为$config['setting']['cache'] = 'redis';

// --------------------------  CONFIG SETTING  --------------------------- //

$config['setting']['charset'] = 'utf-8';

$config['setting']['timezone'] = 'Asia/Shanghai';

$config['setting']['memory_limit'] = '256M';

$config['setting']['filemode'] = 0644;

$config['setting']['authkey'] = 'c445a6b6';

$config['setting']['founder'] = '1';

$config['setting']['development'] = 0;

$config['setting']['referrer'] = 0;

2、redis服务器地址和端口

// --------------------------  CONFIG REDIS  --------------------------- //

$config['setting']['redis']['server'] = '127.0.0.1';  //默认本地,你也可以用云库地址(远程)

$config['setting']['redis']['port'] = 6379;   //默认端口

$config['setting']['redis']['pconnect'] = 1;

$config['setting']['redis']['auth'] = '';  //redis密码, 默认为空

$config['setting']['redis']['requirepass'] = '';   //redis密码,默认为空,没用人人商城删除这行

$config['setting']['redis']['timeout'] = 1;

 

Swoole配置

addons/ewei_shopv2/core/socket下socket.config.php

1、// 设置服务端IP

define('SOCKET_SERVER_IP', 'localhost');

2、// 不管是否开启https均需配置域名

define('SOCKET_CLIENT_IP', ' www.demo.com ');

 

启动服务(先手动启动,再添加自动启动防止服务器重启直播服务关闭)

手动启动

 

 

/www/server/php/56/bin/php -f  /www/wwwroot/ www.demo.com /addons/ewei_shopv2/core/socket/server.php

自动启动

echo "/www/server/php/56/bin/php -f  /www/wwwroot/ www.demo.com /addons/ewei_shopv2/core/socket/server.php" >> /etc/rc.d/rc.local

你可能感兴趣的:(人人商城,互动直播)