
“Maximum execution time of N seconds exceeded” means the script took longer than PHP’s max_execution_time allows and was cut off halfway. Raising that value helps when the work is legitimately slow. When the slowness is a defect (a slow query, an outside service that does not answer), raising the value only hides the problem.
Why it takes so long
| Cause | How to recognise it | What to do |
| A legitimately long task (import, export, building a report) | It always happens on the same button, and only there. | Raise the limit for that folder, or move the work to a scheduled task. |
| A slow database query | The whole site is slow, not one action. | See slow queries. The limit is not the problem. |
| A call to an outside service that does not answer | The delay varies, and it fails without warning. | Put a time limit on the call itself, and handle the failure. |
| An endless loop in the code | It fails at once, every time. | Fix the code. No limit is enough. |
Raising the limit, if that is the case
|
|
|
|
Finding where the time goes
|
|
|
| PHP is not the only clock. The web server and the account’s limits have their own. If you raised the value and the page still dies, the error you see is no longer PHP’s: it may be a 503, 504 or 508. See website errors explained and the limits nobody advertises. |
| Setting the time to zero is not a solution. A script with no limit that gets stuck holds one of your account’s processes until somebody stops it, and spends the resources your site’s other requests need. |
| What is long runs outside the browser. From the command line or from cron the web request disappears, and with it most of these cut-offs. Split the work into small batches that repeat: it is sturdier than one huge batch. See running a PHP script from a cron job. |
|
The page still gets cut off with a high limit? Send us the address, the time it happened and the message. Open a support ticket |
|
SEE ALSO PHP limits: memory, time, upload size and the one that fails silently Running a PHP script from a cron job |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from £5.28/mo (3-year plan, with coupon) See plans |
- 0 Users Found This Useful











