Verbindungstest

PHP läuft. Version: 8.3.6

Suche Konfigurationsdatei: /var/www/html/NexusControl/NexusControl/pages/../assets/config.php

Konfigurationsdatei-Inhalt:

<?php
if (!isset($skipAuth)) {
    if (session_status() === PHP_SESSION_NONE) {
        session_start();
    }
    if (!isset($_SESSION['role'])) {
        header('Location: /NexusControl/pages/login.php');
        exit;
    }
}
// Datenbankkonfiguration
$host = 'localhost';
$dbname = 'u750951906_NexusControl';
$username = 'u750951906_admin';
$password = 'HOk~k5$!0q';

// Discord Webhook-Konstanten (bitte URL bei Bedarf setzen)
if (!defined('DISCORD_WEBHOOK_LEAGUE_ENTRY')) {
    define('DISCORD_WEBHOOK_LEAGUE_ENTRY', 'https://discord.com/api/webhooks/1443517344444977243/47qMNCTVcNnaOh9BGuADN6HQUCPQUfE42lvDcrU3WW7_SU1JEJXfUemwe5CjrIR9kk8R');
}
if (!defined('DISCORD_WEBHOOK_LEAGUE_ENTRY_ZH')) {
    define('DISCORD_WEBHOOK_LEAGUE_ENTRY_ZH', 'https://discord.com/api/webhooks/1443538261694746728/t7yNS0ZeAYcwuPfZFoRWMA6MJOm6fsyxe5lRsi-MirLv8MczULI3MV60iMv2-InbikIG');
}


// Verbindung zur Datenbank herstellen (mysqli für Kompatibilität)
$conn = mysqli_connect($host, $username, $password, $dbname);
if (!$conn) {
    die("Verbindung zur Datenbank fehlgeschlagen: " . mysqli_connect_error());
}
mysqli_set_charset($conn, "utf8mb4");

// PDO Verbindung für bestehenden Code
try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
    $pdo->exec("SET NAMES utf8mb4");
    try {
        $pdo->exec("SET time_zone = 'Europe/Berlin'");
    } catch (PDOException $tzerr) {
        // Zeitzone nicht verfügbar, ignoriere Fehler
    }
} catch(PDOException $e) {
    die("Verbindung zur Datenbank fehlgeschlagen: " . $e->getMessage());
}
?>

Rohinhalt der Konfigurationsdatei:

<?php
if (!isset($skipAuth)) {
    if (session_status() === PHP_SESSION_NONE) {
        session_start();
    }
    if (!isset($_SESSION['role'])) {
        header('Location: /NexusControl/pages/login.php');
        exit;
    }
}
// Datenbankkonfiguration
$host = 'localhost';
$dbname = 'u750951906_NexusControl';
$username = 'u750951906_admin';
$password = 'HOk~k5$!0q';

// Discord Webhook-Konstanten (bitte URL bei Bedarf setzen)
if (!defined('DISCORD_WEBHOOK_LEAGUE_ENTRY')) {
    define('DISCORD_WEBHOOK_LEAGUE_ENTRY', 'https://discord.com/api/webhooks/1443517344444977243/47qMNCTVcNnaOh9BGuADN6HQUCPQUfE42lvDcrU3WW7_SU1JEJXfUemwe5CjrIR9kk8R');
}
if (!defined('DISCORD_WEBHOOK_LEAGUE_ENTRY_ZH')) {
    define('DISCORD_WEBHOOK_LEAGUE_ENTRY_ZH', 'https://discord.com/api/webhooks/1443538261694746728/t7yNS0ZeAYcwuPfZFoRWMA6MJOm6fsyxe5lRsi-MirLv8MczULI3MV60iMv2-InbikIG');
}


// Verbindung zur Datenbank herstellen (mysqli für Kompatibilität)
$conn = mysqli_connect($host, $username, $password, $dbname);
if (!$conn) {
    die("Verbindung zur Datenbank fehlgeschlagen: " . mysqli_connect_error());
}
mysqli_set_charset($conn, "utf8mb4");

// PDO Verbindung für bestehenden Code
try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
    $pdo->exec("SET NAMES utf8mb4");
    try {
        $pdo->exec("SET time_zone = 'Europe/Berlin'");
    } catch (PDOException $tzerr) {
        // Zeitzone nicht verfügbar, ignoriere Fehler
    }
} catch(PDOException $e) {
    die("Verbindung zur Datenbank fehlgeschlagen: " . $e->getMessage());
}
?>

Roh-Matches:

Array
(
)

Gefundene Variablen:

Array
(
)

Allgemeiner Fehler:

Fehlende Konfigurationsparameter: host, dbname, username, password

Datei: /var/www/html/NexusControl/NexusControl/pages/test_connection.php (Zeile: 68)

PHP-Info anzeigen

Server-Informationen:

Betriebssystem: Linux NexusControl 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64PHP-Version: 8.3.6Webserver: Apache/2.4.58 (Ubuntu)