使用前准备
1、安装swoole4.6.5版本(略过)
2、下载swoole的ide-helper方便编写代码
git clone https://github.com/swoole/ide-helper.git
3、在phpstorm左侧右键External Libraries,打开Configure PHP Include Path,点击图标“+” 添加下载好的helper库,应用并且确定。
编写http服务
<?php
\Swoole\Coroutine\run(function (){
$http = new \Swoole\Coroutine\Http\Server('0.0.0.0', 9501);
// 设置