Knowledgebase

Fatal error: Maximum execution time exceeded Print

  • errors, performance, troubleshooting, cpanel, database, php, backup, downtime
  • 0

The script ran longer than permitted.

WHAT IT MEANS

PHP stopped a script that exceeded its time limit.

THE IMMEDIATE FIX

cPanel > MultiPHP INI Editor. Raise max_execution_time to 300.

WHEN THAT IS APPROPRIATE

A one-off operation: a large import, a backup, a bulk update.

WHEN IT IS NOT

Ordinary page loads. A page taking thirty seconds has a real problem that raising the limit hides.

WHAT CAUSES IT

A slow database query, usually missing an index An external API call with no timeout A loop processing more than expected A large file operation

FINDING THE CAUSE

The error names the file and line where time ran out.

For a slow query, enable the slow query log or use a profiling tool.

For an external call, check whether a third-party service is slow or unreachable. Without a timeout, their problem becomes yours.

FOR IMPORTS AND EXPORTS

Process in batches rather than everything at once, or use the command line, which has no time limit.

THE RIGHT ANSWER

Find what is slow. Raising limits indefinitely is not a strategy.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot