Common Troubleshooting
Häufige Probleme und Lösungen bei der Entwicklung mit der Appiyon-Plattform.
Composer Issues
Out of Memory
Problem:
PHP Fatal error: Allowed memory size exhaustedLösung:
php -d memory_limit=-1 /usr/local/bin/composer installPackage Conflicts
Problem:
Your requirements could not be resolved to an installable set of packages.Lösung:
# Dependencies neu berechnen
composer update --with-all-dependencies
# Oder nur spezifisches Package
composer update symfony/framework-bundle --with-dependenciesAutoloader Issues
Problem:
Class 'App\...' not foundLösung:
composer dump-autoload
# Oder mit Optimization
composer dump-autoload -oCache Problems
Stale Cache
Problem:
- Änderungen werden nicht übernommen
- Alte Config-Werte werden verwendet
- Services nicht gefunden
Lösung:
php bin/console cache:clear
php bin/console cache:warmup
# Wenn das nicht hilft, manuell löschen
rm -rf var/cache/*Permission Denied
Problem:
Failed to write cache fileLösung:
# Permissions setzen
chmod -R 777 var/cache/
chown -R www-data:www-data var/cache/
# Oder für Development
chmod -R 777 var/Database Issues
Connection Refused
Problem:
SQLSTATE[08006] Connection refusedLösung:
# PostgreSQL läuft nicht
sudo systemctl start postgresql
# Port prüfen
netstat -tlnp | grep 5432
# Verbindung testen
psql -U appiyonadmin -d symfony -h localhost
# DATABASE_URL prüfen
php bin/console debug:container --env-var=DATABASE_URLPassword Special Characters
Problem:
SQLSTATE[08P01] Invalid passwordLösung:
# Sonderzeichen URL-encoden
# @ → %40
# # → %23
# $ → %24
# % → %25
# & → %26
# Beispiel:
# Password: "p@ss$word"
# Encoded: "p%40ss%24word"
DATABASE_URL="postgresql://user:p%40ss%24word@host/db"Schema Out of Sync
Problem:
The database schema is not in sync with the current mapping fileLösung:
# Schema validieren
php bin/console doctrine:schema:validate
# Diff anzeigen
php bin/console doctrine:schema:update --dump-sql
# Neue Migration erstellen
php bin/console doctrine:migrations:diff
# Migration ausführen
php bin/console doctrine:migrations:migrateService Container Issues
Service Not Found
Problem:
Service "App\..." not foundLösung:
# Services-Liste prüfen
php bin/console debug:container
# Spezifischen Service suchen
php bin/console debug:container Admin
# services.yaml prüfen
# - Namespace korrekt?
# - Resource-Pfad korrekt?
# - Exclude-Patterns richtig?
# Cache leeren
php bin/console cache:clearCircular Reference
Problem:
Circular reference detected for service "App\..."Lösung:
- Dependency-Graph überprüfen
- Lazy Loading nutzen:
public function __construct(
private readonly ContainerInterface $container
) {}
private function getMyService(): MyService
{
return $this->container->get(MyService::class);
}Cannot Autowire
Problem:
Cannot autowire service "App\...": argument "$..." has no type-hintLösung:
// Type-Hint hinzufügen
public function __construct(
MyService $myService // Richtig
) {}
// Oder in services.yaml binden
services:
_defaults:
bind:
$myService: '@App\MyService'Routing Issues
Route Not Found
Problem:
404 Not Found
No route found for "GET /admin"Lösung:
# Routes auflisten
php bin/console debug:router
# Spezifische Route
php bin/console debug:router admin
# Route-Cache leeren
php bin/console cache:clear
# routes.yaml prüfen
# - Controller-Pfad korrekt?
# - Route registered?Apache: No Rewrite
Problem:
- Alle Routes → 404
- Nur /index.php funktioniert
Lösung:
# mod_rewrite aktivieren
sudo a2enmod rewrite
sudo systemctl restart apache2
# .htaccess vorhanden?
ls -la public/.htaccess
# VirtualHost AllowOverride
<Directory /path/to/public>
AllowOverride All
</Directory>PHP Extension Issues
Extension Not Found
Problem:
Fatal error: Class 'PDO' not foundLösung:
# Extensions prüfen
php -m
# Fehlende Extension installieren (Ubuntu)
sudo apt install php8.2-pdo php8.2-pgsql
# PHP-FPM neu starten
sudo systemctl restart php8.2-fpm
# Apache neu starten
sudo systemctl restart apache2Required Extensions
# Check all required
php -m | grep -E "pdo|pdo_pgsql|intl|mbstring|xml|zip|curl|json|tokenizer|ctype"
# Install missing (Ubuntu)
sudo apt install php8.2-common php8.2-cli php8.2-pdo php8.2-pgsql \
php8.2-intl php8.2-mbstring php8.2-xml php8.2-zip php8.2-curlEnvironment Issues
APP_ENV Not Set
Problem:
- Wrong environment aktiv
- Debug-Modus in Production
Lösung:
# .env.local prüfen
cat .env.local | grep APP_ENV
# Oder direkt setzen
export APP_ENV=dev
# Validieren
php bin/console aboutAPP_SECRET Missing
Problem:
Environment variable "APP_SECRET" is not definedLösung:
# Neu generieren
php -r "echo bin2hex(random_bytes(16));"
# In .env.local setzen
APP_SECRET=generated_secret_here
# Cache leeren
php bin/console cache:clearPermission Issues
Cannot Write to Directory
Problem:
Permission denied: var/log/dev.logLösung:
# Permissions setzen
chmod -R 775 var/
chown -R www-data:www-data var/
# Für Development (unsicher für Production!)
chmod -R 777 var/Wrong User
Problem:
- CLI funktioniert, Web nicht (oder umgekehrt)
Lösung:
# Cache/Logs für beide Nutzer (CLI & Web) beschreibbar
sudo setfacl -R -m u:www-data:rwX -m u:$(whoami):rwX var/
sudo setfacl -dR -m u:www-data:rwX -m u:$(whoami):rwX var/Migration Issues
Siehe: Troubleshooting Migrations
Console Command Issues
Command Not Found
Problem:
Command "admin:create" is not definedLösung:
# Command registriert?
php bin/console list admin
# services.yaml prüfen
# App\Appi\Dev\Console\Command\:
# resource: '../src/Appi/Dev/Console/Command'
# tags: ['console.command']
# Cache leeren
php bin/console cache:clearCommand Fails Silently
Problem:
- Command läuft, aber keine Ausgabe
- Exit Code 0, aber nichts passiert
Lösung:
# Verbosity erhöhen
php bin/console admin:create -vvv
# Debug-Modus
APP_DEBUG=1 php bin/console admin:create
# Logs prüfen
tail -f var/log/dev.logDoctrine Issues
Entity Not Mapped
Problem:
Class "App\Appi\Infrastructure\Admin\Entity\Admin" is not a valid entity or mapped super classLösung:
# doctrine.yaml prüfen
# Mapping für Layer vorhanden?
# Cache leeren
php bin/console cache:clear
# Mapping-Info
php bin/console doctrine:mapping:infoMigration Executed Flag Wrong
Problem:
- Migration wurde manuell ausgeführt, aber Doctrine denkt nicht
Lösung:
-- Als postgres User
psql -U appiyonadmin -d symfony
-- Prüfen
SELECT * FROM doctrine_migration_versions;
-- Manuell als executed markieren
INSERT INTO doctrine_migration_versions (version, executed_at, execution_time)
VALUES ('DoctrineMigrations\\Infrastructure\\Version0001', NOW(), 1);EasyAdmin Issues
Siehe: Troubleshooting Admin
Testing Issues
Test Database Not Created
Problem:
SQLSTATE[08006] database "symfony_test" does not existLösung:
# Test-DB erstellen
php bin/console doctrine:database:create --env=test
# Migrations ausführen
php bin/console doctrine:migrations:migrate --env=test --no-interactionTests Failing Randomly
Problem:
- Tests fail manchmal, manchmal nicht
- Abhängig von Ausführungsreihenfolge
Lösung:
- Shared State zwischen Tests
- Database Transactions nutzen
- Test Isolation sicherstellen
protected function setUp(): void
{
$this->connection->beginTransaction();
}
protected function tearDown(): void
{
$this->connection->rollBack();
}Performance Issues
Slow Requests
Lösung:
# Web Profiler nutzen
# Im Dev-Modus unten links Toolbar öffnen
# Query-Profiling
# config/packages/dev/doctrine.yaml
doctrine:
dbal:
logging: true
profiling: true
# Slow Queries finden
SELECT query, calls, total_time, mean_time
FROM pg_stat_statements
ORDER BY mean_time DESC
LIMIT 10;High Memory Usage
Lösung:
# OPcache aktivieren
; php.ini
opcache.enable=1
opcache.memory_consumption=256
# Doctrine Query Cache
# config/packages/prod/doctrine.yaml
doctrine:
orm:
query_cache_driver:
type: pool
pool: doctrine.system_cache_poolDebugging Tools
Symfony Debug Toolbar
Im Dev-Modus automatisch aktiv am unteren Bildschirmrand.
Dump & Die
// In Controller/Service
dump($variable);
dd($variable); // Dump and DieLogger
$this->logger->debug('Debug message', ['context' => $data]);
$this->logger->info('Info message');
$this->logger->error('Error message');Profiler
# Im Browser
# Toolbar öffnen → Klick auf Zeitanzeige
# CLI
php bin/console debug:router
php bin/console debug:container
php bin/console debug:event-dispatcher
php bin/console debug:config frameworkLogs
# Development Log
tail -f var/log/dev.log
# Production Log
tail -f var/log/prod.log
# Apache Error Log
tail -f /var/log/apache2/error.log
# PostgreSQL Log
tail -f /var/log/postgresql/postgresql-16-main.logQuick Fixes Checklist
Wenn etwas nicht funktioniert:
Cache leeren
bashphp bin/console cache:clearLogs prüfen
bashtail -f var/log/dev.logPermissions prüfen
bashls -la var/ chmod -R 777 var/ # Dev only!Database-Verbindung testen
bashpsql -U appiyonadmin -d symfony -h localhostServices prüfen
bashphp bin/console debug:containerRoutes prüfen
bashphp bin/console debug:routerSchema validieren
bashphp bin/console doctrine:schema:validateEnvironment prüfen
bashphp bin/console about php bin/console debug:container --env-vars
Getting Help
Wenn nichts hilft:
Logs sammeln
bashcat var/log/dev.log cat /var/log/apache2/error.logEnvironment-Info
bashphp bin/console about php -v php -mConfig prüfen
bashphp bin/console debug:config framework php bin/console debug:config doctrineReproduktionsschritte dokumentieren
Known Issues prüfen: Known Issues