Skip to content

Admin Panel Troubleshooting

Häufige Probleme beim Admin-Panel und deren Lösungen.

Problem: 404 Error bei /admin

Symptom

https://appisym.go4family.net/admin
→ 404 Not Found

Ursachen & Lösungen

1. .htaccess fehlt im public/ Verzeichnis

Diagnose:

bash
ls -la public/.htaccess
# Wenn "No such file or directory" → .htaccess fehlt

Lösung: Die .htaccess wurde bereits erstellt in: public/.htaccess

Inhalt prüfen:

bash
cat public/.htaccess | head -10
# Sollte "DirectoryIndex index.php" enthalten

2. Document Root zeigt nicht auf public/

Diagnose: Prüfe Apache/Plesk Konfiguration

Lösung für Plesk:

  1. Öffne Plesk → Websites & Domainsappisym.go4family.net
  2. Klicke auf Hosting Settings
  3. Setze Document Root auf:
    /var/www/vhosts/canshare.me/appiyon.com/appisym/public
  4. Aktiviere "Allow .htaccess usage"
  5. Speichern

Alternative: Symlink erstellen

bash
cd /var/www/vhosts/appisym.go4family.net/
rm -rf httpdocs
ln -s /var/www/vhosts/canshare.me/appiyon.com/appisym/public httpdocs

3. Routes nicht registriert

Diagnose:

bash
php bin/console debug:router | grep admin
# Sollte "admin" Route anzeigen

Lösung: Cache leeren:

bash
php bin/console cache:clear

Problem: 403 Forbidden bei /admin

Symptom

Access Denied
Admin panel is only accessible via appisym.go4family.net (current host: andere-domain.com)

Ursache

Domain Restriction blockiert Zugriff von anderen Domains

Lösung

Für Production (gewollt): Greife nur über die korrekte Domain zu:

https://appisym.go4family.net/admin

Für lokale Entwicklung: Ändere .env.local:

bash
# .env.local
ADMIN_DOMAIN=localhost

Domain Restriction temporär deaktivieren:

yaml
# config/services.yaml - NUR FÜR ENTWICKLUNG!
when@dev:
    services:
        App\Appi\Dev\Http\EventSubscriber\AdminDomainRestrictionSubscriber:
            tags: [] # Deaktiviert

Problem: 500 Internal Server Error

Symptom

Internal Server Error

Diagnose

Schritt 1: Logs prüfen

bash
# Symfony Logs
tail -f var/log/dev.log

# Apache Error Logs
tail -f /var/log/apache2/error.log
# oder
tail -f /var/www/vhosts/appisym.go4family.net/logs/error_log

Schritt 2: Debug-Modus aktivieren

bash
# .env
APP_ENV=dev
APP_DEBUG=1

Häufige Ursachen

1. Composer Dependencies fehlen

Lösung:

bash
composer install

2. Cache-Probleme

Lösung:

bash
rm -rf var/cache/*
php bin/console cache:clear

3. Permissions falsch

Lösung:

bash
chmod -R 775 var/
chmod -R 775 public/bundles/
chown -R www-data:www-data var/

4. Doctrine Mapping-Fehler

Fehler:

Class "Admin" not found

Lösung:

bash
# Cache leeren
php bin/console cache:clear

# Doctrine Schema validieren
php bin/console doctrine:schema:validate

Problem: Login funktioniert nicht

Symptom

Admin-Seite lädt, aber Login schlägt fehl

Ursache

Security Bundle ist noch nicht konfiguriert

Aktueller Stand

⚠️ Authentication noch nicht implementiert

Die Admin-Entities existieren, aber die Symfony Security-Integration fehlt noch.

Temporäre Lösung

Aktuell ist das Admin-Panel nur für die Verwaltung von Daten gedacht, nicht für Login.

Geplante Lösung

  • Security Bundle konfigurieren
  • Admin UserProvider erstellen
  • Login-Form implementieren
  • Authentication Handler

Problem: EasyAdmin-Seiten laden nicht

Symptom

/admin funktioniert
/admin/admin gibt 404

Diagnose

bash
php bin/console debug:router | grep admin_admin
# Sollte Admin CRUD-Routes anzeigen

Lösung

1. Cache leeren:

bash
php bin/console cache:clear

2. Controller-Registrierung prüfen:

yaml
# config/services.yaml
App\Appi\Dev\Http\Controller\:
    resource: '../src/Appi/Dev/Http/Controller'
    tags: ['controller.service_arguments']

3. EasyAdmin Bundle installiert?

bash
composer show easycorp/easyadmin-bundle
# Sollte v4.26.5 oder höher anzeigen

Problem: Datenbank-Verbindung fehlschlägt

Symptom

Connection refused
SQLSTATE[08006]

Diagnose

bash
# Prüfe .env
cat .env | grep DATABASE_URL

# Teste Verbindung
php bin/console dbal:run-sql "SELECT 1"

Lösung

1. Database URL korrigieren:

bash
# .env
DATABASE_URL="postgresql://user:password@127.0.0.1:5432/dbname?serverVersion=16&charset=utf8"

2. Datenbank existiert?

bash
# Erstellen falls nötig
php bin/console doctrine:database:create

3. PostgreSQL läuft?

bash
sudo systemctl status postgresql
# oder
pg_isready

Problem: Migrations schlagen fehl

Symptom

Migration failed
Table already exists

Lösung

Siehe: Troubleshooting Migrations

Problem: Assets (CSS/JS) laden nicht

Symptom

Admin-Panel sieht kaputt aus (kein Styling)

Diagnose

bash
ls -la public/bundles/

Lösung

1. Assets installieren:

bash
php bin/console assets:install --symlink public

2. Permissions prüfen:

bash
chmod -R 755 public/bundles/

3. Bei 404 für Assets: Prüfe .htaccess - sollte statische Files durchlassen

Debugging-Tools

1. Routes prüfen

bash
# Alle Routes anzeigen
php bin/console debug:router

# Spezifische Route testen
php bin/console router:match /admin

# Route-Details
php bin/console debug:router admin

2. Services prüfen

bash
# Alle Services
php bin/console debug:container

# Spezifischer Service
php bin/console debug:container AdminDomainRestrictionSubscriber

3. Events prüfen

bash
# Event Listeners
php bin/console debug:event-dispatcher kernel.request

4. Doctrine prüfen

bash
# Schema validieren
php bin/console doctrine:schema:validate

# Mapping Info
php bin/console doctrine:mapping:info

# Migrations Status
php bin/console doctrine:migrations:status

5. Cache-Info

bash
# Cache-Pool Status
php bin/console cache:pool:list

# Cache leeren
php bin/console cache:clear
php bin/console cache:warmup

Checkliste für Admin-Panel

Bei Problemen diese Checkliste durchgehen:

  • [ ] .htaccess existiert in public/
  • [ ] Document Root zeigt auf appisym/public
  • [ ] ADMIN_DOMAIN in .env ist korrekt
  • [ ] Routes sind registriert (debug:router | grep admin)
  • [ ] Datenbank-Verbindung funktioniert
  • [ ] Migrationen sind ausgeführt
  • [ ] Cache ist geleert
  • [ ] Composer Dependencies installiert
  • [ ] File Permissions sind korrekt
  • [ ] Apache/PHP läuft
  • [ ] PostgreSQL läuft

Logs und Debugging

Wichtige Log-Dateien

Symfony:

bash
var/log/dev.log
var/log/prod.log

Apache:

bash
/var/log/apache2/error.log
/var/www/vhosts/appisym.go4family.net/logs/error_log

PHP-FPM:

bash
/var/log/php-fpm/error.log

Logging Level erhöhen

yaml
# config/packages/dev/monolog.yaml
monolog:
    handlers:
        main:
            level: debug  # Mehr Logs

Support

Wenn nichts hilft:

  1. Alle Schritte aus der Checkliste durchgehen
  2. Logs prüfen
  3. Stack Trace analysieren
  4. Minimal reproduzierbares Beispiel erstellen
  5. Issue auf GitHub erstellen (wenn öffentlich)

Siehe auch

Built with VitePress