Default Max Execution Time

PHP restricts how long any script can run through the max_execution_time INI setting. By default this value is 30 seconds.

It is recommended to reduce this value for several reasons:

  • Several long running scripts at the same time can cause congestion, preventing other request sfrom users from being executed. These usually manifests in HTTP 503 errors from the webserver.

  • Great user experience is about quick response times, 30 seconds is far away from that. You can configure the max_execution_time to be higher for individual scripts at runtime, when its necessary. But for the general use-case in an application, the maximum execution time should be expected to be much lower.

It is also necessary to understand, that max_execution_time is based on the time spent executing the script, all I/O operations such as SQL queries, HTTP requests or filesystem access do not count towards the execution time.

This means that max_execution_time is not reliable way to restrict the time spent running a script.

Still need help? Email [email protected]