Авторизация через steam

Я сделал систему входа на своем сайте но при кнопке войти сайт уходит в ошибку и пишет “HTTP ERROR 500”
Что делать???
ПОМОГИТЕ
сайт https://wh16097.web3.maze-host.ru/

Какая-то ошибка на бэкенде. Посмотри на своем хостинге логи ошибок

[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: HTTP_X_REAL_IP in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/classes/base.class.php on line 256
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: show_icon in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/item.html on line 1
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: show_icon in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/item.html on line 1
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: show_icon in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/item.html on line 1
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: show_icon in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/item.html on line 1
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: show_icon in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/item.html on line 1
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: page in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/home.html on line 11
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: page in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/home.html on line 17
[21-Apr-2024 21:34:22 Europe/Moscow] PHP Notice: Undefined index: page in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/tpl/menu/home.html on line 17
[21-Apr-2024 21:34:25 Europe/Moscow] PHP Notice: Undefined index: HTTP_X_REAL_IP in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/classes/base.class.php on line 256
[21-Apr-2024 21:34:30 Europe/Moscow] PHP Notice: Undefined index: HTTP_X_REAL_IP in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/classes/base.class.php on line 256
[21-Apr-2024 21:34:32 Europe/Moscow] PHP Fatal error: Uncaught Error: Call to undefined function bcdiv() in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/classes/base.class.php:99
Stack trace:
#0 /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/pages/login.php(49): Base::ToSteamID(‘765611988336378…’)
#1 /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/index.php(55): include(‘/var/www/wh1609…’)
#2 {main}
thrown in /var/www/wh16097/data/www/wh16097.web3.maze-host.ru/classes/base.class.php on line 99

PHP Fatal error: Uncaught Error: Call to undefined function bcdiv()

Вот конфинг login

<?php Base::TakeClass('openid'); if($logged_user) { include ROOT . "pages/404.php"; return; } try { $redirect = (isset($_GET['rdrct']))? $_GET['rdrct']: ''; $openid = new LightOpenID('https://' . $_SERVER['SERVER_NAME'] . '/login?rdrct='.$redirect); if (!$openid->mode) { if (isset($_GET['login'])) { $openid->identity = 'http://steamcommunity.com/openid/?l=english'; header('Location: ' . $openid->authUrl()); } // include (ROOT."pages/404.php"); } elseif ($openid->mode == 'cancel') { echo 'User has canceled authentication!'; } else { if ($openid->validate()) { $id = $openid->identity; // identity is something like: http://steamcommunity.com/openid/id/76561197960435530 // we only care about the unique account ID at the end of the URL. $ptn = "/^https:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/"; preg_match($ptn, $id, $matches); // echo "User is logged in (steamID: $matches[1])\n"; $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$_STEAMAPI&steamids=$matches[1]"; $json_object = file_get_contents($url); $json_decoded = json_decode($json_object); foreach ($json_decoded->response->players as $player) { /*echo "
Player ID: $player->steamid
Player Name: $player->personaname
Profile URL: $player->profileurl
SmallAvatar:
MediumAvatar:
LargeAvatar: ";*/ $status = json_encode( array( 'admin'=>'', 'nom'=>1, 'date'=>time() ) ); $sessionID = $player->steamid . "_". Base::randString(100); $db->execute("DELETE FROM `sessions` WHERE `session_date` < NOW() - INTERVAL 1 MONTH "); $db->execute("INSERT INTO `players` (`SID`, `group`, `status`) VALUES ('" . $db->safe(Base::ToSteamID($player->steamid)) . "', 'user', '$status')"); $db->execute("INSERT INTO `sessions` (`session_id`, `session_steamid`, `session_date`) VALUES ('$sessionID', '" . $db->safe(Base::ToSteamID($player->steamid)) . "', NOW())"); $db->execute("INSERT INTO `user_info_cache` (`steamid`, `steam_url`, `avatar_url`, `nickname`) VALUES ('" . $db->safe(Base::ToSteamID($player->steamid)) . "', '" . $db->safe($player->profileurl) . "', '" . $db->safe($player->avatarfull) . "', '" . $db->safe($player->personaname) . "')" . "ON DUPLICATE KEY UPDATE `steam_url`='" . $db->safe($player->profileurl) . "', `avatar_url`='" . $db->safe($player->avatarfull) . "', `nickname`='" . $db->safe($player->personaname) . "'") or die($db->error()); setcookie("mitrastroi_sid", $sessionID, time() + 3600 * 24 * 30, '/', $_SERVER['HTTP_HOST']); $db->execute("INSERT INTO `login_log` (`SID`, `ip`) VALUES ('" . $db->safe(Base::ToSteamID($player->steamid)) . "', '".Base::GetRealIp()."')"); header("Location: /$redirect"); } } else { header("Location: /$redirect"); } } } catch (ErrorException $e) { echo $e->getMessage(); }