Php 队列不会启动laravel 8
php artisan队列:工作-不工作。 ErrorException:尝试访问null类型值的数组偏移量 vendor/laravel/framework/src/illumb/Queue/QueueManager.php:156Php 队列不会启动laravel 8,php,laravel,Php,Laravel,php artisan队列:工作-不工作。 ErrorException:尝试访问null类型值的数组偏移量 vendor/laravel/framework/src/illumb/Queue/QueueManager.php:156 protected function resolve($name) { $config = $this->getConfig($name); return $this->getConnector($config['
protected function resolve($name)
{
$config = $this->getConfig($name);
return $this->getConnector($config['driver'])
->connect($config)
->setConnectionName($name);
}
config/queue.php
<?php
return [
'default' => env('QUEUE_CONNECTION', 'sync'),
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
]
];
在.env
文件中,您的队列连接是什么。如果使用自定义连接,则必须在config/queue.php
中定义driver
键。我显示了代码队列。我不太明白我需要修复什么?您的config/queue.php
是正确的。.env
上的QUEUE\u CONNECTION
值错误。它应该是数据库
而不是数据库
。