Skip to content

Hosting & PHP

max_execution_time on shared hosting: measured limits for Multisite backups

We timed PHP's execution limit on Linux and Windows, collected the documented limits of five hosts and traced which timeout actually ends a long WordPress Multisite backup request.

Phillip RosenheinrichLast reviewed 9 min readPrimary sources checked

What does max_execution_time actually limit?

max_execution_time caps how long PHP may run one script; the default is 30 seconds and the command line has no limit [2][3]. On Linux, standard builds count only time spent running PHP code, so sleep, database queries and network waits are not counted; on Windows they are [1]. In a Multisite backup the request is usually cut off by another layer first: nginx after 60 seconds without output, Cloudflare after 125 seconds [5][7].

What we measured: CPU time on Linux, wall-clock time on Windows

The PHP manual says the limit only covers the execution of the script itself, and that this is not true on Windows, where the measured time is real [1]. Builds compiled with Zend Max Execution Timers, the default for thread-safe builds since PHP 8.3, measure elapsed time instead, so sleeping and waiting count there as well [2]. We wanted to see the difference with our own eyes, so we set a 2-second limit and ran three small scripts on a Linux server and on a Windows PC.

The result matches the manual. On Linux, sleep(5) finished after 5.00 seconds without any error, because sleeping is not execution time. A pure CPU loop died at exactly 2.00 seconds. Three seconds of sleep followed by a CPU loop died at 5.00 seconds: the sleep was ignored and the loop got its full 2 seconds. On Windows the sleep script was killed, and the combined script died after 3.01 seconds.

One detail surprised us: on Windows the fatal error for sleep(5) did not appear at 2 seconds but at 5.01 seconds. PHP noticed the timeout only after the blocking call had returned. That suggests a script stuck in one long database query or network read can run well past its limit before PHP ends it.

Script (limit 2 s, median of 3 runs) Linux, PHP 8.5.12 Windows, PHP 8.2.12
sleep(5) finished, 5.00 s fatal error at 5.01 s
CPU loop fatal error at 2.00 s fatal error at 2.01 s
sleep(3) + CPU loop fatal error at 5.00 s fatal error at 3.01 s

Which layer ends the request first

A backup request in the browser passes through several timers, and the shortest one wins. The WordPress handbook makes the same point: a high PHP limit is pointless when the web server gives up earlier [17]. PHP itself defaults to 30 seconds for web requests and to 0, meaning unlimited, on the command line [2][3]. PHP-FPM has its own kill switch, request_terminate_timeout, which is off by default and exists for scripts that the execution limit does not stop [4].

In front of PHP, nginx waits 60 seconds by default for the next chunk of data from PHP-FPM; the timer restarts with every read, so a script that keeps sending output can run longer [5]. Apache's TimeOut directive defaults to 60 seconds in the current 2.4 documentation, while the PHP manual still mentions 300 seconds for Apache and IIS, so check the value your host really uses [6][2]. If the site sits behind Cloudflare, the proxy waits 125 seconds for a response and then shows error 524; only Enterprise plans can raise that, up to 6,000 seconds [7].

Layer Setting Default What you see
PHP max_execution_time 30 s (CLI: unlimited) Fatal error: Maximum execution time exceeded
PHP-FPM request_terminate_timeout 0 (off) Worker killed in the middle of the request
nginx fastcgi_read_timeout 60 s between two reads Gateway timeout
Apache TimeOut 60 s Request ends with an error
Cloudflare Proxy Read Timeout 125 s Error 524

Published limits at five hosts

Hosts document their limits in very different places, and some let you change nothing. These values come from each host's own documentation, read on 1 November 2026. Kinsta allows 300 seconds on most plans and 600 seconds on the largest ones [8]. WP Engine sets 60 seconds, allows only lower values and asks you to split longer tasks into batches [9]. Hostinger lists 360 seconds on its web plans and 480 seconds on cloud plans [10].

netcup ties the value to the plan: you cannot change it, and neither can support [11]. Webhosting 1000, 2000, 4000 and 8000 each list 180 seconds; memory is 128 MB on Webhosting 1000, 512 MB on 2000 and 4000 and 1024 MB on 8000 [12][13][14][15]. SiteGround names max_execution_time among the settings that cannot be changed on shared servers, while support can adjust it on Cloud plans [16].

Host Execution limit What the host says
Kinsta 300 s; 600 s on the largest plans Set per plan
WP Engine 60 s Can only be lowered
Hostinger 360 s web, 480 s cloud Set per plan type
netcup Webhosting 180 s (1000 to 8000) Tied to the plan, support cannot change it
SiteGround shared No number in the KB Fixed on shared; Cloud via support

Note what this means behind Cloudflare: even with 360 or 600 seconds of PHP time, a single proxied request still ends after 125 seconds [7].

Why a higher limit rarely saves a Multisite backup

A network backup mostly reads files, queries the database and writes archives. On Linux much of that is often waiting rather than executing, so the PHP timer may still be far from its limit when nginx or Cloudflare has already closed the connection [1][5][7]. Raising max_execution_time from 30 to 300 seconds then changes nothing visible: the browser still gets a gateway error, and the PHP process may keep running unseen.

The robust answer is to keep every request short and to resume the work in the next one. WP Engine says exactly that for tasks above its 60 seconds [9], and it is how chunked backup tools are built. For heavy one-off jobs the command line is the other way out, because the CLI has no time limit by default and no proxy sits in between [3]. Cloudflare's own suggestion for requests that regularly take longer than 125 seconds is a DNS-only subdomain that bypasses the proxy [7].

How Multisite Migrate sizes its work slices

We wrote Multisite Migrate for exactly these hosts, so here is what the plugin does, straight from its public source code. Every background step in the browser gets a time budget computed from the server's max_execution_time, and the budget never exceeds 15 seconds; the comment in the code explains why: shared proxies often kill requests at 30 seconds [18]. Without a limit the plugin still uses 15 seconds per step.

Before each step the worker calls ignore_user_abort(true), so a closed tab does not cut a step in half. On WP-CLI, WP-Cron and the command line it removes the limit with set_time_limit(0); in browser requests it sets the limit to the server value, at least 10 seconds [19]. The Health screen shows a warning when max_execution_time is above zero but below 30 seconds [20].

Server max_execution_time Budget per step
0 (unlimited) 15 s
8 s 7 s
10 s 7 s
20 s 12 s
30 s or more 15 s

Check your real limits in five minutes

Do not trust a value you read on the command line. WP-CLI runs PHP's CLI, whose default limit is 0, so wp eval usually prints 0 even when web requests stop after 30 seconds [3]. Our own server printed exactly that: max_execution_time => 0 in the CLI. Read the web value instead, from Tools > Site Health > Info > Server (entry “PHP time limit”) in WordPress or with a small temporary file like the one below.

  • Open the file once in the browser, note SAPI and the limit, then delete it.
  • fpm-fcgi means PHP-FPM behind nginx or Apache: ask the host for fastcgi_read_timeout or TimeOut.
  • A value of 0 in the browser means no PHP limit, but proxies still apply.
  • In the Cloudflare dashboard, check whether the record is proxied (orange cloud).
  • If set_time_limit is disabled, plugins cannot extend their time at runtime.
<?php
header('Content-Type: text/plain');
echo 'SAPI: ', PHP_SAPI, "\n";
echo 'max_execution_time: ', ini_get('max_execution_time'), "\n";
echo 'set_time_limit: ', function_exists('set_time_limit') ? 'available' : 'disabled', "\n";

Troubleshooting by error message

The error text tells you which layer stopped the request, and that decides the fix. Raising a PHP value never repairs a proxy timeout, and asking the host for a longer proxy timeout does not help when PHP itself is the limit [17].

What you see Likely layer Next step
Maximum execution time of N seconds exceeded PHP Raise the limit if the host allows it, or use smaller steps
504 after about 60 s nginx or Apache Ask for the read timeout, or use smaller steps
Error 524 after about 125 s Cloudflare Smaller steps, WP-CLI, or a DNS-only subdomain
502 at a round number of seconds PHP-FPM Check request_terminate_timeout in the pool
No error, job stalls Background trigger Check WP-Cron and loopback requests

Checklist before a large network backup

  • Read the web value of max_execution_time, not the CLI value.
  • Know your host's documented ceiling and whether you may change it.
  • Find out whether nginx, Apache or Cloudflare sit in front, and with which timeout.
  • Prefer a tool that works in steps of 15 seconds or less and resumes after an interruption.
  • Run very large one-off jobs through WP-CLI when you have SSH.
  • After the backup, open the log and confirm that every step completed.

How we tested

On 1 November 2026 we ran one PHP test script with set_time_limit(2) in three modes: sleep(5), an endless CPU loop and sleep(3) followed by the loop. A shutdown function printed the wall-clock time measured with microtime(true). Linux: production server with PHP 8.5.12 CLI, non-thread-safe build, Zend Max Execution Timers disabled. Windows: a desktop PC with PHP 8.2.12 CLI, thread-safe build. Each mode ran three times per system; the table shows the median, and the runs differed by at most 0.04 seconds. We did not test web SAPIs or a Linux build with Zend Max Execution Timers. Host limits come only from the hosts' own pages, read the same day; plugin behaviour is taken from the public source of Multisite Migrate 1.2.24.

Frequently asked questions

Does sleep() count toward max_execution_time?

On Linux with a standard build it does not: in our test sleep(5) finished under a 2-second limit. On Windows, and on Linux builds with Zend Max Execution Timers, the wall-clock time counts.

Why does WP-CLI show max_execution_time = 0?

WP-CLI uses PHP's command-line interface, whose default limit is 0, meaning unlimited. Your web requests can still have 30 seconds or less. Check the value in Site Health or with a temporary PHP file in the browser.

What value should I set for backups?

Whatever your host allows, but do not rely on it. Behind nginx a request usually ends after 60 seconds without output and behind Cloudflare after 125 seconds. A backup tool that works in short, resumable steps is more reliable than a longer limit.

Can I change max_execution_time on netcup web hosting?

No. On netcup web hosting the value is tied to the plan and support cannot change it either. Webhosting 1000, 2000, 4000 and 8000 each list 180 seconds; only managed private servers allow custom values.

Does a higher limit help against Cloudflare error 524?

No. Error 524 means Cloudflare waited 125 seconds for your server's response. PHP may still be running. Make each request shorter, run the job through WP-CLI, or use a DNS-only subdomain for the long task.

Sources

  1. set_time_limitPHP Manual · checked November 9, 2026
  2. Runtime configuration: max_execution_timePHP Manual · checked November 9, 2026
  3. Differences from other SAPIsPHP Manual · checked November 9, 2026
  4. FastCGI Process Manager (FPM) configurationPHP Manual · checked November 9, 2026
  5. Module ngx_http_fastcgi_module: fastcgi_read_timeoutnginx.org · checked November 9, 2026
  6. Apache HTTP Server 2.4 core features: TimeOut directiveApache Software Foundation · checked November 9, 2026
  7. Error 524: a timeout occurredCloudflare Docs · checked November 9, 2026
  8. Reference – Technical FAQKinsta · checked November 9, 2026
  9. Configure Account Platform SettingsWP Engine · checked November 9, 2026
  10. Parameters and limits of hosting plans in HostingerHostinger · checked November 9, 2026
  11. PHP Settingsnetcup · checked November 9, 2026
  12. Webhosting 1000 NUE bei netcupnetcup · checked November 9, 2026
  13. Webhosting 2000 NUE bei netcupnetcup · checked November 9, 2026
  14. Webhosting 4000 NUE bei netcupnetcup · checked November 9, 2026
  15. Webhosting 8000 NUE bei netcupnetcup · checked November 9, 2026
  16. How to change the value of a PHP setting?SiteGround · checked November 9, 2026
  17. PHP OptimizationWordPress Developer Resources · checked November 9, 2026
  18. Multisite Migrate 1.2.24 source code: includes/class-hosting-detection.phpWordPress.org Plugin SVN · checked November 9, 2026
  19. Multisite Migrate 1.2.24 source code: includes/class-backup-runner.phpWordPress.org Plugin SVN · checked November 9, 2026
  20. Multisite Migrate 1.2.24 source code: includes/class-health.phpWordPress.org Plugin SVN · checked November 9, 2026

Related guides and comparisons

Make your first restorable network backup for free.