1. 在tp框架根目录下建立server\http_server.php
文件
<?php
use Swoole\Http\Server as HttpServer;
$http = new HttpServer("127.0.0.1", 8811);
$http->set([
'worker_num' => 5,
'enable_static_handler' => true,
'document_root' => '/home/buinar/www/swoole/livematches/public/static',
//document_root目录下要放一个ico图标,为了防止浏览器请求ico图标时走下面的流程
'log_level' => SWOOLE_LOG_ERROR, // 日志等级 关闭开启debug
'trace_flags' => SWOOLE_TRACE_SERVER, // 日志等级 关闭开启debug
]);
$http->on('WorkerStart'