lsky-pro
lsky-pro copied to clipboard
AMH 面板下使用Supervisor启动队列处理进程遇到的问题
更新 发现只要是生成缩略图的命令都会遇到 Class "Redis" not found报错
AMH面板,执行命令会遇到这个问题: 似乎是默认调用的redis命令,但是amh面板在使用命令时出于安全考虑,需要以**/usr/local/redis-6.2/bin/redis-cli xxxx** 的形式来执行 同理,php也需要 /usr/local/php-8.1/bin/php artisan queue:work --queue=emails,images 形式执行 报错如下,请教下该如何解决:
Error
Class "Redis" not found
at vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:81
77▕ * @throws \LogicException
78▕ */
79▕ protected function createClient(array $config)
80▕ {
➜ 81▕ return tap(new Redis, function ($client) use ($config) {
82▕ if ($client instanceof RedisFacade) {
83▕ throw new LogicException(
84▕ extension_loaded('redis')
85▕ ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
+7 vendor frames
8 [internal]:0
Illuminate\Cache\TagSet::tagId("app")
+6 vendor frames
15 app/functions.php:86
Illuminate\Cache\Repository::rememberForever("configs", Object(Closure))```
日志2
[2023-07-07 01:12:03] prod.ERROR: Class "Redis" not found {"exception":"[object] (Error(code: 0): Class "Redis" not found at /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:81) [stacktrace] #0 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(34): Illuminate\Redis\Connectors\PhpRedisConnector->createClient(Array) #1 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(38): Illuminate\Redis\Connectors\PhpRedisConnector->Illuminate\Redis\Connectors\{closure}() #2 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php(112): Illuminate\Redis\Connectors\PhpRedisConnector->connect(Array, Array) #3 /home/wwwroot/LNMP02-HIGH/domain/../web/lsky-pro/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php(91): Illuminate\Redis\RedisManager->resolve('cache') #4 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php(258): Illuminate\Redis\RedisManager->connection('cache') #5 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php(62): Illuminate\Cache\RedisStore->connection() #6 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php(107): Illuminate\Cache\RedisStore->get('tag:app:key') #7 [internal function]: Illuminate\Cache\TagSet->tagId('app') #8 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php(96): array_map(Array, Array) #9 /home/wwwroot/LNMP02-HIGH/domain/./web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/TagSet.php(86): Illuminate\Cache\TagSet->tagIds() #10 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php(102): Illuminate\Cache\TagSet->getNamespace() #11 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/TaggedCache.php(91): Illuminate\Cache\TaggedCache->taggedItemKey('configs') #12 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(99): Illuminate\Cache\TaggedCache->itemKey('configs') #13 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(429): Illuminate\Cache\Repository->get('configs') #14 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/app/functions.php(86): Illuminate\Cache\Repository->rememberForever('configs', Object(Closure)) #15 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/app/Providers/AppServiceProvider.php(46): c('app_name') #16 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Providers\AppServiceProvider->boot() #17 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #18 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) #19 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #20 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #21 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(929): Illuminate\Container\Container->call(Array) #22 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(910): Illuminate\Foundation\Application->bootProvider(Object(App\Providers\AppServiceProvider)) #23 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(App\Providers\AppServiceProvider), 25) #24 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(911): array_walk(Array, Object(Closure)) #25 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot() #26 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(242): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application)) #27 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(383): Illuminate\Foundation\Application->bootstrapWith(Array) #28 /home/wwwroot/LNMP02-HIGH/domain//web/lsky-pro/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(153): Illuminate\Foundation\Console\Kernel->bootstrap() #29 /home/wwwroot/LNMP02-HIGH/domain/***/web/lsky-pro/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #30 {main} "}
php需要安装redis拓展