1:安装swoole
1.1:Composer 安装与使用 https://www.runoob.com/w3cnote/composer-install-and-usage.html
Linux 平台可以使用以下命令来安装:
# php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
# php composer-setup.php
All settings correct for using Composer
Downloading...
Composer (version 1.6.5) successfully installed to: /root/composer.phar
Use it: php composer.phar
移动 composer.phar,这样 composer 就可以进行全局调用:
# mv composer.phar /usr/local/bin/composer
切换为国内镜像:
# composer config -g repo.packagist composer https://packagist.phpcomposer.com
更新 composer:
# composer selfupdate
1.2:端口冲突报错
netstat -anp | grep 9501
kill -9 xxx
2:安装cmf-swoole ~之后跟的是版本号 cmf5.0的需要安装2.0.0版本的
composer require topthink/think-swoole:~2.0.0
3:创建server端代码 运行启动
感谢以下参考链接:https://blog.csdn.net/msllws/article/details/84405127