# Laravel: Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 30 seconds exceeded

**Code:** `Maximum execution time of 30 seconds exceeded` · **Category:** Laravel · **Seen on:** Laravel, PHP

A web request ran longer than PHP's `max_execution_time` and was killed.

## Meaning

Long tasks shouldn't run in web requests. Dispatch a queued job, optimise queries (indexes, eager loading to avoid N+1), cache results, or temporarily raise `max_execution_time` / `set_time_limit()`. Behind Nginx also check `fastcgi_read_timeout`.

## Common causes

- Heavy report/export in the request
- N+1 queries
- Slow external API call
- Infinite loop
- Default 30s limit on shared hosting

## Quick fix

1. Move to a queued job with `dispatch()`
2. Add indexes and eager loading (`with()`)
3. Raise `max_execution_time` and `fastcgi_read_timeout` if needed

## Detailed fix by platform

### Laravel

1. `php artisan make:job ProcessReport` then `ProcessReport::dispatch($id);`

## How to diagnose

1. **Cause** — Slow query, API or loop?
2. **Time** — Which limit?
3. **Queue** — Possible?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/laravel/maximum-execution-time-exceeded)
