Error message

PHP: Maximum execution time of 30 seconds exceeded

A script ran longer than max_execution_time. PHP stops it with a fatal error, and the Sentry SDK still manages to send it. The limit is 30 seconds under a web server by default and none on the command line, so this error mostly hits web requests, queued work run over HTTP and imports started from a page.

Updated

Examples run on 21 November 2026 with PHP 8.6.0, sentry/sentry 4.17.1, 4.27.0 and 4.38.0, and Laravel 13.43.0 with sentry/sentry-laravel 4.31.0. Errilo is in private beta.

What the message says

A loop that never ends, with the limit lowered to 2 seconds so the example is quick:

timeout.php
<?php
// timeout.php, run with: php timeout.php
ini_set('max_execution_time', '2');
function crunch(): void {
    while (true) { md5(random_bytes(16)); }   // line 5: CPU work, never ends
}
crunch();
Fatal error: Maximum execution time of 2 seconds exceeded in /app/timeout.php on line 18
Stack trace:
#0 /app/timeout.php(18): random_bytes(16)
#1 /app/timeout.php(20): crunch()
#2 {main}
Fatal error: Maximum execution time of 2 seconds exceeded in /app/timeout.php on line 9
Stack trace:
#0 /app/timeout.php(9): sleep(5)
#1 {main}

Fixes

import.php
<?php
// Five batches of about one second of work, with max_execution_time = 2
ini_set('max_execution_time', '2');
foreach (range(1, 5) as $batch) {
    set_time_limit(2);   // restarts the counter: each batch gets its own 2 seconds
    $until = microtime(true) + 1;
    while (microtime(true) < $until) { md5(random_bytes(16)); }
    echo "batch $batch done\n";
}

What the PHP SDK captures

The timeout is a fatal error, so the fatal error listener of the SDK sends it from its shutdown function. In our runs the script was already stopped and the event still arrived, in plain PHP and in Laravel after the 30 seconds. With plain sentry/sentry:

With Laravel 13.43.0 and sentry/sentry-laravel 4.31.0, the error goes through Laravel’s handler: type Symfony\Component\ErrorHandler\Error\FatalError, message Maximum execution time of 30 seconds exceeded, no level, the request attached, one frame (the line of the route).

When something outside PHP kills the process, nothing is sent. We ran a busy loop with no PHP limit and sent it a SIGKILL after 3 seconds: exit code 137, no event at all. A supervisor or a proxy that kills slow requests produces the same silence, but we did not test PHP-FPM’s request_terminate_timeout or a particular proxy.

The setup is in the Laravel guide. We did not run this error on Symfony; the Symfony guide covers the setup.

How Errilo shows it

The issue is titled with the type and message (Sentry\Exception\FatalErrorException: Error: Maximum execution time of 2 seconds exceeded), unhandled, level Fatal with the plain SDK and Error with Laravel. With 4.38.0 the location is the innermost frame of your code; with the one-frame versions, the file.

Errilo groups on the exception type and the frames. We ran its grouping code on our events: the limit in the message doesn’t matter, but with the one-frame versions, a timeout and a memory error that end in the same file get the same fingerprint, so they land in one issue. We saw it with the Laravel events of both errors, in routes/web.php. With 4.38.0 and its call stack, a timeout groups by the path of calls instead.

Early access

The private beta is open, by invitation, to a handful of teams running a JavaScript, TypeScript, PHP or Python app in production. Join the waitlist and we’ll write to invite you.