<?php
use think\swoole\websocket\socketio\Handler;
use think\swoole\websocket\socketio\Parser;
return [
'server' => [
'host' => env('SWOOLE_HOST', '127.0.0.1'), // 监听地址
'port' => env('SWOOLE_PORT', 80), // 监听端口
'mode' => SWOOLE_PROCESS, // 运行模式 默认为SWOOLE_PROCESS
'sock_type' => SWOOLE_SOCK_TCP, // sock type 默认为SWOOLE_SOCK_TCP
// 'app_path' => '/var/www/wwwroot/0tp6/app',
// 'type' => 'http',
'options' => [
'pid_file' => runtime_path() . 'swoole.pid',
'log_file' => runtime_path() . 'swoole.log',
'daemonize' => false,
// Normally this value should be 1~4 times larger according to your cpu cores.
'reactor_num' => swoole_cpu_num(),
'worker_num' => swoole_cpu_num(),
'task_worker_num' => swoole_cpu_num(),
'task_enable_coroutine' => true,
'task_max_request' => 3000,
'enable_static_handler' => true,
'document_root' => root_path('public'),
'package_max_length' => 20 * 1024 * 1024,
'buffer_output_size' => 10 * 1024 * 1024,
'socket_buffer_size' => 128 * 1024 * 1024,
'max_request' => 3000,
'send_yield' => true,
],
],
...使用sudo php think swoole 启动服务器。访问localhost 能出来下面的
ThinkPHP V6
13载初心不改 - 你值得信赖的PHP框架
但是使用f5刷新就会出现
控制器不存在:app\think\controller\Index 这样的报错.访问其他路径都是 app\think\controller\XXX报错
最佳答案