解决Command "laravoole" is not defined.
解决 not is quot Command defined
2023-09-11 14:16:35 时间
版权声明:本文为博主原创文章,未经博主允许不得转载。
GitHub地址:https://github.com/garveen/laravoole
先来执行正常的安装流程:
安装
要开始,将laravoole添加到composer.json文件并运行composer update
:
"garveen/laravoole": "^0.5.0"
或者只是运行shell命令:
composer require garveen/laravoole
一旦composer完成工作,您需要在您的config / app.php中注册Laravel服务提供商:
'providers' => [ ... Laravoole\LaravooleServiceProvider::class, ],
注意:您不应该使用文件会话处理程序,因为它在此环境中不稳定。改用redis或其他处理程序。
用法
php artisan laravoole [start | stop | reload | reload_task | restart | quit]
结果一运行,。。。
![](https://images2017.cnblogs.com/blog/1130688/201708/1130688-20170821013658308-1014366595.png)
开始跳坑,
网上查了一下,资料好少,基本来自stackoverflow
建议一:尝试composer update
然后php artisan dump-autoload
再重试。(好像不管用)
建议二:编辑你的app/Console/Kernel.php
文件并将你的命令添加到$commands
数组中。
试了一下建议二:
vim blog/app/Console/Kernel.php
//use Laravoole; protected $commands = [ // //Laravoole\LaravooleServiceProvider::class, ];
尝试引入Laravoole到Kernel,后来发现不对
![](https://images2017.cnblogs.com/blog/1130688/201708/1130688-20170821013741730-409664280.png)
最后实在没有办法,在bootstrap/cache/services.php加入Laravoole配置
vim bootstrap/cache/services.php
'deferred' => array ( ... 'command.laravoole' => 'Illuminate\\Support\\ServiceProvider\\LaravooleServiceProvider', );
报了一个刚才乱改blog/app/Console/Kernel.php的错
![](https://images2017.cnblogs.com/blog/1130688/201708/1130688-20170821013807152-165812233.png)
还原了blog/app/Console/Kernel.php,bootstrap/cache/services.php
![](https://images2017.cnblogs.com/blog/1130688/201708/1130688-20170821013845824-1553837508.png)
居然神奇的启动了,怀疑是缓存的问题!(不太清楚,如有其他见解,请评论留言哈!)
然后根据文档配置了laravoole.php,重启了laravoole。
laravoole.php 可以改一些配置参数
<?php namespace Laravoole; return [ // for laravoole itself 'base_config' => [ 'host' => env('LARAVOOLE_HOST', '127.0.0.1'), 'port' => env('LARAVOOLE_PORT', 9050), // this file storages the pid of laravoole 'pid_file' => env('LARAVOOLE_PID_FILE', storage_path('/logs/laravoole.pid')), ... ... ...
![](https://images2017.cnblogs.com/blog/1130688/201708/1130688-20170821013904183-902479544.png)
接下来就可以用Apache的ab测试Laravoole的性能优化效果啦!!!
相关文章
- ValueError: {0} is not a valid coordinate or range问题解决
- 解决bash: mysql: command not found 的方法
- HDFS报错解决:Operation category JOURNAL is not supported in state standby
- 成功解决TypeError: ‘int‘ object is not callable
- 成功解决ERROR: Could not find a version that satisfies the requirement xgboost (from versions: none) ERR
- Py之GUI之PyQt:成功解决Exception “unhandled TypeError“ expected str, bytes or os.PathLike object, not tuple
- 成功解决ERROR: Could not build wheels for bottleneck, which is required to install pyproject.toml-based
- 成功解决NameError: name ‘norm‘ is not defined
- 成功解决NameError: name 'unicode' is not defined
- 成功解决TypeError: a bytes-like object is required, not 'str'
- 已解决note: This is an issue with the package mentioned above,not pip.
- 已解决sys:1: FutureWarning: Could not cast to float64, falling back to object. This behavior is depreca
- 已解决Script file ‘E:anacondainstall_rootScriptspip-script.py‘ is not present.
- 已解决xlrd.biffh.XLRDError: Excel xlsx file:not supported
- 关于 ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported ,已解决
- 【C语言】解决 “error: function definition is not allowed here”
- 解决QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root‘问题
- 解决java.lang.IllegalArgumentException: Could not resolve placeholder ‘xxx‘ in value “${xxx}“问题
- vue3 报错解决:找不到模块‘xxx.vue’或其相应的类型声明。(Vue 3 can not find module)
- 问题解决:Failed to XXX mysqld.service: Unit not found
- C++使用技巧(一):解决C++类class C 库函数strcpy使用方法以及出现的报错问题: ‘strcpy’ was not declared in this scope
- Mybatis出现Parameter ‘XXX‘ not found. Available parameters are [0, 1, param1, param2]错误解决方法