我在 laravel 中使用 pusher 发送通知,但出现以下错误:
{消息:“无法连接到 Pusher。”,异常:“Illuminate\Broadcasting\BroadcastException”,...} 异常:“Illuminate\Broadcasting\BroadcastException”文件:“C:\wamp64\www\notify\vendor\laravel\framework \src\Illuminate\Broadcasting\Broadcasters\PusherBroadcaster.php”行:121 消息:“无法连接到 Pusher。”
.env:
APP_URL=http://localhost
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=XXX
PUSHER_APP_KEY=XXXX
PUSHER_APP_SECRET=XXX
PUSHER_APP_CLUSTER=ap2
广播.php
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => false,
'host' => '127.0.0.1',
'port' => 6001,
'scheme' => 'http',
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
],
],