Does this match what you’re seeing?
- Log shows ‘Maximum execution time of 30 seconds exceeded’
- Imports or backups stop partway
- A page loads for a long time and then errors
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/user/domains/yourdomain.co.uk/public_html/import.php on line 88
PHP stops scripts that run longer than max_execution_time, so a stuck script can’t tie up the server indefinitely.
Why long web requests are a bad idea anyway
Even with a higher limit, browsers, proxies and CDNs often give up on a request after a minute or two. Long jobs are better done in smaller pieces.
Better approaches
- Batching: process 500 records per request, then continue from where you stopped, either with a page that reloads itself or an AJAX loop.
- Cron: run heavy jobs on a schedule from the command-line PHP, where time limits usually differ. Running PHP scripts from cron: paths, output and common mistakes
- Import databases without PHP scripts where possible. Importing a database that’s too large for phpMyAdmin
- Fix slow queries — a missing database index can make a one-second job take minutes.
Raising the limit
If a job genuinely needs a bit longer, check whether max_execution_time is adjustable. Changing PHP settings: memory_limit, upload size and execution time In a script, you can request more time where allowed:
<?php set_time_limit(120);
Server-level ceilings still apply.
Everything in this guide works on Traxio’s PHP hosting, which is free for 30 days and £0.99 a month after that.