- 首先购买腾讯云服务器2G内存以上OK,选择Linux(CentOs、Ubuntu、Debian等)安装系统;
- 安装宝塔,然后进行环境搭建(Nginx1,PHP7,MYSQL5,FTP等);
- 安装Composer,或更新到最新版本(安装详细如下);
#安装composer1、下载composer:curl-sShttps://getcomposer.org/installer|php注:如果出现bash:php未找到命令#解决:1)打开环境变量配置文件vim/etc/profile2)将php安装目录添加进环境变量exportPATH=$PATH:/usr/local/php/bin注意:PATN后面跟你的php安装目录find/-namephp//查找php安装路径,目录最后带bin/php的一般是php的安装目录了3)刷新配置文件使之生效source/etc/profile4)成功解决[root@localhost~]#php–v2、移动(全局安装)sudomvcomposer.phar/usr/local/bin/composer3、查看版本号composer–v4、更新最新版本composerselfupdatecomposer官方:Packagist/Composer中国全量镜像
- 进入项目存放目录www/wwwroot,安装Tp6,若安装过程有报错,请设置php配置文件;
#安装tp6composercreate-projecttopthink/think项目名称tp6开发手册:安装·ThinkPHP6.0完全开发手册·看云
- 进入项目目录/tp6,安装workerman、gateway,安装成功后启动workerman;
[root@VM-16-10-centostp6]#composerrequiretopthink/think-worker
#启动workenman[root@VM-16-10-centostp6]#phpthinkworker:serverTp6扩展库workerman:Workerman·ThinkPHP6.0完全开发手册·看云
workerman官方手册:workerman手册