Back to Error Center

500 Server Error

Error Message

500 SERVER_ERROR

Cause

An unhandled exception occurred. This is a generic error that masks the actual problem. Check the Laravel log file for the real error.

Solution

Check storage/logs/laravel.log for the actual error. Enable APP_DEBUG=true in development to see detailed errors. Check the stack trace for the root cause.

Code Example

Fix
# Check the log file
tail -f storage/logs/laravel.log

# Or in .env for development (never in production)
APP_DEBUG=true

# Clear config cache if changed .env
php artisan config:clear

Debugging Steps

  1. Check storage/logs/laravel.log for the exception
  2. Enable APP_DEBUG=true in development only
  3. Check for PHP syntax errors with php -l
  4. Review recent code changes
  5. Check server error logs (Nginx/Apache)

Prevention

Always handle exceptions gracefully. Use try-catch for expected failures. Test code thoroughly before deploying. Keep APP_DEBUG=false in production.