Comments (2)
好冷清。
from yii2-swoole.
处理了,这样配置就ok了。
<?php $params = array_merge( require(__DIR__ . '/../../common/config/params.php'), require(__DIR__ . '/../../common/config/params-local.php'), require(__DIR__ . '/params.php'), require(__DIR__ . '/params-local.php') ); defined('SWOOLE_PROCESS') or define('SWOOLE_PROCESS', 1); defined('SWOOLE_TCP') or define('SWOOLE_TCP', 1); return [ 'id' => 'app-console', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'console\controllers', 'components' => [ 'log' => [ 'targets' => [ [ 'class' => yii\log\FileTarget::className(), 'levels' => ['error', 'warning'], ], ], ], 'session' => [ 'class' => yii\web\Session::className() ] ], 'controllerMap'=>[ 'serve' => [ 'class' => yii\console\controllers\ServeController::className(), 'docroot' => '@frontend/web', ], 'swoole' => [ 'class' => feehi\console\SwooleController::className(), 'rootDir' => str_replace('console/config', '', __DIR__ ),//yii2项目根路径 'type' => 'advanced',//yii2项目类型,默认为advanced。此处还可以为basic 'app' => 'frontend',//app目录地址,如果type为basic,这里一般为空 'host' => '127.0.0.1',//监听地址 'port' => 9999,//监听端口 'web' => 'web',//默认为web。rootDir app web目的是拼接yii2的根目录,如果你的应用为basic,那么app为空即可。 'debug' => true,//默认开启debug,上线应置为false 'env' => 'dev',//默认为dev,上线应置为prod 'swooleConfig' => [//标准的swoole配置项都可以再此加入 'reactor_num' => 2, 'worker_num' => 4, 'daemonize' => false, 'log_file' => __DIR__ . '/../../frontend/runtime/logs/swoole.log', 'log_level' => 0, 'pid_file' => __DIR__ . '/../../frontend/runtime/server.pid', ], ], 'swoole-backend' => [ 'class' => feehi\console\SwooleController::className(), 'rootDir' => str_replace('console/config', '', __DIR__ ),//yii2项目根路径 'app' => 'backend', 'host' => '127.0.0.1', 'port' => 9998, 'web' => 'web',//默认为web。rootDir app web目的是拼接yii2的根目录,如果你的应用为basic,那么app为空即可。 'debug' => true,//默认开启debug,上线应置为false 'env' => 'dev',//默认为dev,上线应置为prod 'swooleConfig' => [ 'reactor_num' => 2, 'worker_num' => 4, 'daemonize' => false, 'log_file' => __DIR__ . '/../../backend/runtime/logs/swoole.log', 'log_level' => 0, 'pid_file' => __DIR__ . '/../../backend/runtime/server.pid', ], ] ], 'params' => $params, ];
from yii2-swoole.
Related Issues (20)
- 大神可以的
- Exception 'Error' with message 'Class 'swoole_http_server' not found' HOT 1
- 为啥在我本地虚拟机上感觉不到变快 HOT 1
- 网址打不开了
- Setting read-only property: feehi\web\Session::name HOT 1
- frontend error
- 启动时出错。 HOT 1
- 又是高级版的?没有基础版提供吗 HOT 1
- task 任务 HOT 2
- swoole/restart重启时pid文件不存在导致报错 HOT 1
- windows不能用吧?
- 为什么数据库一直再创建连接?
- 无法正常打印yii2.log HOT 4
- 发现了一个错误 HOT 1
- swoole怎么看到效果?frontend.php这个文件是做什么用的? HOT 1
- 最新版yii2,安装你这个插件后访问报错yii\base\InvalidCallException: Setting read-only property: feehi\web\Session::name HOT 2
- yii2 2.0.16,可以运行,但debug条出不来,提示view不存在 HOT 1
- 用ab测试好像会内存溢出,ab -c 1000 -t 3 url就出现下面的错误,什么地方 可以设置内存大小的?还是说在脚本启动的时候设置?
- websocket
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-swoole.