500 Internal Server Error in Laravel - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

500 Internal Server Error in Laravel
====================================

### [\#Laravel](https://rocketeersapp.com/knowledge/laravel)

A 500 error is a generic "something broke" on the server. The error itself tells you nothing, the real message is in your logs. Here is where to look and the usual culprits.

 Published by [Mark van Eijk](https://rocketeersapp.com/author/mark-van-eijk) on June 23, 2026 · 1 minute read

1. [About error 500](#content-about-error-500)
2. [Where to look first](#content-where-to-look-first)
3. [Common causes](#content-common-causes)
4. [Solution](#content-solution)
5. [Temporarily see the real error](#content-temporarily-see-the-real-error)
6. [Clear stale caches](#content-clear-stale-caches)
7. [Re-cache for production](#content-re-cache-for-production)

[\#](#content-about-error-500 "Permalink")About error 500
---------------------------------------------------------

A `500 Internal Server Error` means the server hit an unhandled error while processing the request. It's deliberately generic: in production Laravel hides the details so it doesn't leak sensitive information to visitors. The actual cause is always written somewhere you can read.

[\#](#content-where-to-look-first "Permalink")Where to look first
-----------------------------------------------------------------

Don't guess, read the log. For Laravel:

 ```
tail -n 100 storage/logs/laravel.log

```

If nothing's there, the error happened before Laravel booted, so check the web server and PHP-FPM logs:

 ```
tail -n 100 /var/log/nginx/error.log
tail -n 100 /var/log/php8.3-fpm.log

```

See [logging in Laravel](/laravel-logging) for configuring where these go.

[\#](#content-common-causes "Permalink")Common causes
-----------------------------------------------------

- **Missing `APP_KEY`**, see [No application encryption key has been specified](/no-application-encryption-key-has-been-specified).
- **File permissions** on `storage` or `bootstrap/cache`, see [failed to open stream: Permission denied](/laravel-failed-to-open-stream-permission-denied).
- **A stale cached config** referencing values that no longer exist.
- **A missing `.env`** or wrong database credentials.
- **A PHP error**, out of memory, or a fatal syntax error in deployed code.

[\#](#content-solution "Permalink")Solution
-------------------------------------------

### [\#](#content-temporarily-see-the-real-error "Permalink")Temporarily see the real error

On a staging or local environment, enable debug mode to render the actual exception instead of the generic page:

 ```
APP_DEBUG=true

```

**Never leave `APP_DEBUG=true` on in production**, it exposes stack traces, environment values and database details to the public. Turn it back off the moment you've found the cause.

### [\#](#content-clear-stale-caches "Permalink")Clear stale caches

A frequent cause right after deploy is a cached config or view pointing at something stale:

 ```
php artisan optimize:clear

```

This clears the config, route, view and event caches in one go, see [clearing the cache in Laravel](/clear-cache-laravel).

### [\#](#content-re-cache-for-production "Permalink")Re-cache for production

Once it works, rebuild the caches for performance:

 ```
php artisan config:cache
php artisan route:cache

```

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#Laravel](https://rocketeersapp.com/knowledge/laravel)

- [How to use different PHP versions with Laravel Valet](https://rocketeersapp.com/knowledge/different-php-versions-laravel-valet)
- [Disable cookies in Laravel](https://rocketeersapp.com/knowledge/disable-cookies-in-laravel)
- [Logging in Laravel](https://rocketeersapp.com/knowledge/laravel-logging)
- [How to check which Laravel version of your app is using](https://rocketeersapp.com/knowledge/check-laravel-version)
- [Disable CSRF in Laravel](https://rocketeersapp.com/knowledge/disable-csrf-in-laravel)
- [Creating an encrypted cookie value in Laravel](https://rocketeersapp.com/knowledge/creating-an-encrypted-cookie-value-in-laravel)

 [View all 19 articles →](https://rocketeersapp.com/knowledge/laravel)
