Я пытаюсь протестировать и изучить вещание laravel с эхом. Но после попыток и попыток я не могу добиться того, чего хочу. Он работает с общедоступным каналом. Но когда дело доходит до каналов присутствия, это не так. Для устранения ошибки я сделал:
Увеличение лимита памяти php до 1 ГБ
Я использую Jetstream и Fortify. Также InertiaJS.
Заголовки авторизации отладки браузера
Получил ошибку
error: "Unable to retrieve auth string from auth endpoint - received status: 500 from /broadcasting/auth. Clients must be authenticated to join private or presence channels. See: https://pusher.com/docs/authenticating_users"
status: 500
App.js
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
cluster: process.env.MIX_PUSHER_APP_CLUSTER,
forceTLS: true,
});
window.Echo.join(`chat.1`)
.here((users) => {
console.log(users);
})
.joining((user) => {
console.log(user.name);
})
.leaving((user) => {
console.log(user.name);
})
.error((error) => {
console.error(error);
});
BroadcastServiceProvider.php
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
каналы.php
Broadcast::channel('chat.{ida}', function ($user, $ida) {
if (auth()->check()) {
return $user->toArray();
}
});
site.net.error.log
[Sun May 16 10:24:49.754522 2021] [fcgid:warn] [pid 14900] [client ip:38966] mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard
[Sun May 16 10:26:31.944725 2021] [fcgid:warn] [pid 4715] [client ip:39000] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 861929472) (tried to allocate 262144 bytes) in *sitepath*/private/app_data/vendor/pusher/pusher-php-server/src/Pusher.php on line 840, referer: https://abcabc.net/dashboard
[Sun May 16 10:26:31.954042 2021] [fcgid:warn] [pid 4715] [client ip:39000] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 861929472) (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard
[Sun May 16 10:27:12.115963 2021] [fcgid:warn] [pid 19725] [client ip:39026] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 394264576) (tried to allocate 262144 bytes) in *sitepath*/private/app_data/vendor/pusher/pusher-php-server/src/Pusher.php on line 840, referer: https://abcabc.net/dashboard
[Sun May 16 10:27:12.120752 2021] [fcgid:warn] [pid 19725] [client ip:39026] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 394264576) (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard
[Sun May 16 10:30:19.624249 2021] [fcgid:warn] [pid 14898] [client ip:39066] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 710934528) (tried to allocate 262144 bytes) in *sitepath*/private/app_data/vendor/pusher/pusher-php-server/src/Pusher.php on line 840, referer: https://abcabc.net/dashboard
[Sun May 16 10:30:19.636461 2021] [fcgid:warn] [pid 14898] [client ip:39066] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 710934528) (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard
[Sun May 16 10:30:38.961347 2021] [fcgid:warn] [pid 14898] [client ip:39086] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 551550976) (tried to allocate 262144 bytes) in *sitepath*/private/app_data/vendor/pusher/pusher-php-server/src/Pusher.php on line 840, referer: https://abcabc.net/dashboard
[Sun May 16 10:30:38.963699 2021] [fcgid:warn] [pid 14898] [client ip:39086] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 551550976) (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard
[Sun May 16 10:31:03.040755 2021] [fcgid:warn] [pid 14897] [client ip:39104] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 276824064) (tried to allocate 262144 bytes) in *sitepath*/private/app_data/vendor/pusher/pusher-php-server/src/Pusher.php on line 840, referer: https://abcabc.net/dashboard
[Sun May 16 10:31:03.049553 2021] [fcgid:warn] [pid 14897] [client ip:39104] mod_fcgid: stderr: PHP Fatal error: Out of memory (allocated 276824064) (tried to allocate 262144 bytes) in Unknown on line 0, referer: https://abcabc.net/dashboard