This guide covers common issues and how to fix them.
Symptom:
Error: Class 'App\Controllers\UserController' not found
Solution:
composer dump-autoload
Symptom: White screen with no error message.
Solutions:
.env:
APP_DEBUG=true
tail -f storage/logs/app.log
php -i | grep error_log
Symptom: HTTP 500 error response.
Solutions:
tail -f storage/logs/app.log
APP_DEBUG=true
chmod -R 775 storage/
chmod -R 775 bootstrap/cache/
Symptom:
SQLSTATE[HY000]: General error: 14 unable to open database file
Solution (SQLite):
touch database/app.sqlite
chmod 775 database/app.sqlite
Symptom:
SQLSTATE[28000]: Access denied for user 'root'@'localhost'
Solution: Check .env:
DB_HOST=localhost
DB_USERNAME=your_username
DB_PASSWORD=your_password
Symptom: Migration errors.
Solutions:
.envphp marwa migrate -vvv
config/database.phpSymptom: Table doesn’t exist errors.
Solution: Run migrations:
php marwa migrate
Symptom: Sessions don’t persist.
Solution:
config/session.phpchmod -R 775 storage/framework/sessions/
Symptom: Login doesn’t persist.
Solution: Check cookie settings:
// config/session.php
return [
'driver' => 'cookie', // or 'file'
'cookie_name' => 'marwa_session',
'cookie_lifetime' => 120,
];
Symptom: Email not sending.
Solution: Check mail config in config/mail.php:
return [
'driver' => 'smtp',
'host' => 'smtp.mailtrap.io',
'port' => 2525,
'username' => 'your_username',
'password' => 'your_password',
];
Symptom: Email validation error.
Solution: Set valid from address:
return [
'from' => [
'address' => 'noreply@yourdomain.com',
'name' => 'Your App',
],
];
Symptom: Cached data doesn’t persist.
Solutions:
php marwa cache:clear
.env:
CACHE_DRIVER=file
Symptom: Routes not loading after caching.
Solution: Clear route cache:
php marwa route:clear
Symptom:
Command "make:user" is not defined.
Solution:
php marwa list
to see available commands.
Symptom:
Cannot execute marwa.
Solution:
chmod +x marwa
Solution:
# Linux/Apache
sudo chown -R www-data:www-data storage/ bootstrap/cache/
# macOS
sudo chown -R _www:_www storage/ bootstrap/cache/
Solution:
chmod -R 775 storage/
chmod -R 775 bootstrap/cache/
chmod -R 775 database/
Solutions:
php marwa route:cache
; php.ini
opcache.enable=1
opcache.memory_consumption=128
; php.ini
xdebug.mode=off
Solutions:
$users = User::with('posts')->get();
APP_DEBUG=true
APP_ENV=local
# Application logs
tail -f storage/logs/app.log
# Framework logs
tail -f storage/logs/framework.log
composer test
composer stan
| Code | Meaning | Solution |
|---|---|---|
| 404 | Not found | Check route exists |
| 500 | Server error | Check logs |
| 419 | CSRF token | Refresh page |
| 422 | Validation | Check input |
| 401 | Unauthorized | Check auth |