我构建了一个聊天室API,该API使用Laravel事件和侦听器,通过pusher进行广播,并通过laravel echo和Vue侦听那些公共和私有频道。
但是,我陷入困境的是必须重新安装wamp64并将Laravel应用程序移动到新安装的wamp64 / www /路径后,composer已根据需要更新了所有依赖关系,但所有事件都在新文件夹内,但是事件和作业会出现问题排队。每次触发事件时,作业都会失败。
我想指出我的Pusher帐户正在运行,原因是听众在聊天室中工作。广播/作业在卡住的地方排队。(正在订阅聊天室频道,但是它没有从事件/广播接收消息)。
以下是失败的作业异常。
Illuminate\Broadcasting\BroadcastException in C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\PusherBroadcaster.php:117
Stack trace:
#0 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Broadcasting\BroadcastEvent.php(48): Illuminate\Broadcasting\Broadcasters\PusherBroadcaster->broadcast(Array, 'App\\Events\\NewC...', Array)
#1 [internal function]: Illuminate\Broadcasting\BroadcastEvent->handle(Object(Illuminate\Broadcasting\Broadcasters\PusherBroadcaster))
#2 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#3 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\Container.php(572): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#6 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#7 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Illuminate\Broadcasting\BroadcastEvent))
#8 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Broadcasting\BroadcastEvent))
#9 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(Illuminate\Broadcasting\BroadcastEvent), false)
#11 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(83): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)
#12 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(327): Illuminate\Queue\Jobs\Job->fire()
#13 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(277): Illuminate\Queue\Worker->process('database', Object(Illuminate\Queue\Jobs\DatabaseJob), Object(Illuminate\Queue\WorkerOptions))
#14 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(118): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\DatabaseJob), 'database', Object(Illuminate\Queue\WorkerOptions))
#15 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(102): Illuminate\Queue\Worker->daemon('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#16 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(86): Illuminate\Queue\Console\WorkCommand->runWorker('database', 'default')
#17 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()
#18 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(29): call_user_func_array(Array, Array)
#19 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#20 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#21 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Container\Container.php(572): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#22 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Console\Command.php(183): Illuminate\Container\Container->call(Array)
#23 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Command\Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#24 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Console\Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#25 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Application.php(901): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 C:\wamp64\www\nathanreynolds\vendor\symfony\console\Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Console\Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 C:\wamp64\www\nathanreynolds\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 C:\wamp64\www\nathanreynolds\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 {main}
有效载荷
{"displayName":"App\\Events\\NewChat","job":"Illuminate\\Queue\\CallQueuedHandler@call","maxTries":null,"timeout":null,"timeoutAt":null,"data":{"commandName":"Illuminate\\Broadcasting\\BroadcastEvent","command":"O:38:\"Illuminate\\Broadcasting\\BroadcastEvent\":7:{s:5:\"event\";O:18:\"App\\Events\\NewChat\":4:{s:4:\"chat\";a:5:{s:3:\"rid\";s:1:\"1\";s:5:\"owner\";s:18:\"frezknow@gmail.com\";s:4:\"body\";s:9:\"tigfdhugs\";s:10:\"created_at\";s:19:\"2019-02-16 18:04:33\";s:4:\"user\";O:8:\"stdClass\":2:{s:4:\"name\";s:15:\"Nathan Reynolds\";s:3:\"img\";s:49:\"uploads\/frezknow@gmail.com\/1550337650_DSC0140.jpg\";}}s:6:\"status\";s:6:\"public\";s:4:\"user\";O:45:\"Illuminate\\Contracts\\Database\\ModelIdentifier\":4:{s:5:\"class\";s:8:\"App\\User\";s:2:\"id\";i:1;s:9:\"relations\";a:0:{}s:10:\"connection\";s:5:\"mysql\";}s:6:\"socket\";N;}s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}"}}
很明显我遇到了连接问题,这是奇怪的,因为我的Vue组件中没有问题就可以连接。?
第117行的州
throw new BroadcastException(
is_bool($response) ? 'Failed to connect to Pusher.' : $response['body']
);
答案 0 :(得分:0)
由于跟随文件(cacert.pem)不在我的PHP_versionx.xxx/extras/ssl/文件夹中,以及需要在php.ini文件中引用的文件,因此无法连接到PUSHER。 / p>
资源 https://github.com/laravel/framework/issues/16478请阅读[shadoWalker89]的答案。 What exactly is cacert.pem for?