132 lines
4.0 KiB
PHP
132 lines
4.0 KiB
PHP
<?php
|
|
// Debug-Script für HTTP 500 Internal Server Error
|
|
// Führen Sie dies aus, um das Problem zu diagnostizieren
|
|
|
|
echo "🔍 Debug: HTTP 500 Internal Server Error\n";
|
|
echo "=======================================\n\n";
|
|
|
|
// 1. Prüfe Laravel-Logs
|
|
echo "1. Laravel-Logs prüfen:\n";
|
|
$logFiles = [
|
|
'storage/logs/laravel.log',
|
|
'storage/logs/laravel-' . date('Y-m-d') . '.log'
|
|
];
|
|
|
|
foreach ($logFiles as $logFile) {
|
|
if (file_exists($logFile)) {
|
|
echo " 📋 $logFile gefunden\n";
|
|
echo " 📄 Letzte 10 Zeilen:\n";
|
|
$lines = file($logFile);
|
|
$lastLines = array_slice($lines, -10);
|
|
foreach ($lastLines as $line) {
|
|
echo " " . trim($line) . "\n";
|
|
}
|
|
} else {
|
|
echo " ❌ $logFile nicht gefunden\n";
|
|
}
|
|
}
|
|
|
|
// 2. Prüfe PHP-Fehler
|
|
echo "\n2. PHP-Fehler prüfen:\n";
|
|
$errorLog = ini_get('error_log');
|
|
if ($errorLog && file_exists($errorLog)) {
|
|
echo " 📋 PHP Error Log: $errorLog\n";
|
|
$lines = file($errorLog);
|
|
$lastLines = array_slice($lines, -5);
|
|
foreach ($lastLines as $line) {
|
|
echo " " . trim($line) . "\n";
|
|
}
|
|
} else {
|
|
echo " ⚠️ PHP Error Log nicht verfügbar\n";
|
|
}
|
|
|
|
// 3. Prüfe Apache-Logs
|
|
echo "\n3. Apache-Logs prüfen:\n";
|
|
$apacheLogs = [
|
|
'/var/log/apache2/error.log',
|
|
'/var/log/apache2/neonail_error.log'
|
|
];
|
|
|
|
foreach ($apacheLogs as $logFile) {
|
|
if (file_exists($logFile)) {
|
|
echo " 📋 $logFile gefunden\n";
|
|
echo " 📄 Letzte 5 Zeilen:\n";
|
|
$lines = file($logFile);
|
|
$lastLines = array_slice($lines, -5);
|
|
foreach ($lastLines as $line) {
|
|
echo " " . trim($line) . "\n";
|
|
}
|
|
} else {
|
|
echo " ❌ $logFile nicht gefunden\n";
|
|
}
|
|
}
|
|
|
|
// 4. Prüfe Dateisystem
|
|
echo "\n4. Dateisystem prüfen:\n";
|
|
$criticalFiles = [
|
|
'public/index.php' => 'Laravel Entry Point',
|
|
'bootstrap/app.php' => 'Laravel Bootstrap',
|
|
'vendor/autoload.php' => 'Composer Autoload',
|
|
'config/app.php' => 'App Config',
|
|
'.env' => 'Environment File',
|
|
'database.sqlite' => 'Database File'
|
|
];
|
|
|
|
foreach ($criticalFiles as $file => $description) {
|
|
if (file_exists($file)) {
|
|
$perms = substr(sprintf('%o', fileperms($file)), -4);
|
|
echo " ✅ $description: $file (Perms: $perms)\n";
|
|
} else {
|
|
echo " ❌ $description fehlt: $file\n";
|
|
}
|
|
}
|
|
|
|
// 5. Prüfe Verzeichnisberechtigungen
|
|
echo "\n5. Verzeichnisberechtigungen prüfen:\n";
|
|
$directories = [
|
|
'storage' => 'Storage Directory',
|
|
'storage/logs' => 'Logs Directory',
|
|
'storage/framework' => 'Framework Directory',
|
|
'storage/framework/cache' => 'Cache Directory',
|
|
'storage/framework/sessions' => 'Sessions Directory',
|
|
'storage/framework/views' => 'Views Directory',
|
|
'bootstrap/cache' => 'Bootstrap Cache'
|
|
];
|
|
|
|
foreach ($directories as $dir => $description) {
|
|
if (is_dir($dir)) {
|
|
$perms = substr(sprintf('%o', fileperms($dir)), -4);
|
|
$writable = is_writable($dir) ? 'writable' : 'not writable';
|
|
echo " ✅ $description: $dir (Perms: $perms, $writable)\n";
|
|
} else {
|
|
echo " ❌ $description fehlt: $dir\n";
|
|
}
|
|
}
|
|
|
|
// 6. Prüfe Laravel-Bootstrap
|
|
echo "\n6. Laravel-Bootstrap Test:\n";
|
|
try {
|
|
require_once 'vendor/autoload.php';
|
|
echo " ✅ Composer Autoload erfolgreich\n";
|
|
|
|
$app = require_once 'bootstrap/app.php';
|
|
echo " ✅ Laravel App erstellt\n";
|
|
|
|
$kernel = $app->make('Illuminate\Contracts\Console\Kernel');
|
|
echo " ✅ Kernel erstellt\n";
|
|
|
|
$kernel->bootstrap();
|
|
echo " ✅ Laravel Bootstrap erfolgreich\n";
|
|
|
|
} catch (Exception $e) {
|
|
echo " ❌ Laravel-Fehler: " . $e->getMessage() . "\n";
|
|
echo " 📍 Datei: " . $e->getFile() . ":" . $e->getLine() . "\n";
|
|
}
|
|
|
|
echo "\n🔧 Nächste Schritte:\n";
|
|
echo "1. Prüfen Sie die Laravel-Logs für detaillierte Fehlermeldungen\n";
|
|
echo "2. Aktivieren Sie APP_DEBUG=true in .env\n";
|
|
echo "3. Prüfen Sie die Apache-Logs für Server-Fehler\n";
|
|
echo "4. Stellen Sie sicher, dass alle Verzeichnisse beschreibbar sind\n";
|
|
?>
|