PHP Fatal error: Maximum execution time of 30 seconds exceeded means a PHP script ran longer than it's allowed, so PHP stopped it part-way through. It often happens during big imports, backups, plugin updates or image processing. This guide explains what the maximum execution time exceeded error means, how to raise max_execution_time in your Instant Access Internet Services cPanel, and what to do when a task is simply too long for a web page.
What the error looks like
In your error_log, WordPress's debug.log or the WordPress "Technical Issue" email:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/username/public_html/wp-content/plugins/some-plugin/file.php on line 456
The number of seconds is your current limit. The file path shows which script was running when time ran out. On screen, visitors may see a blank or half-loaded page, a 500 error, or "There has been a critical error on this website". An import or update may stop half-way with no clear message.
How to fix it: raise max_execution_time in MultiPHP INI Editor
- Log in to cPanel and go to Software > MultiPHP INI Editor.
- On the Basic Mode tab, choose your domain under Configure PHP INI basic settings.
- Find
max_execution_timeand enter a higher number of seconds, for example120. For large imports you can go up to300. - If the task involves uploading a big file, raise
max_input_timeto the same value. - Click Apply, then try the task again.
The current value for each domain is shown on that page. For more on this editor, see How to Change PHP Settings (memory_limit, upload_max_filesize). In WordPress you can also check it under Tools > Site Health > Info > Server ("PHP time limit").
If the new limit doesn't apply
- Check you chose the right domain and clicked Apply.
- Look for an old
php_value max_execution_timeline in.htaccess, or aphp.inior.user.inifrom a previous host, and remove it. (php_valuelines in.htaccesscan also cause 500 errors.) - Some plugins and scripts set their own time limit in code (with
set_time_limit()), which overrides your setting while they run. Check the plugin's settings or documentation for a "timeout" or "batch size" option.
When raising the limit isn't the answer
A short, one-off task that needs a bit more time is fixed by the steps above. But if a normal page takes more than a few seconds, something is wrong, and more time just makes visitors wait longer. Look for:
- A slow or stuck plugin. The file path in the error points to it. Update it, or disable it to test (see WordPress Critical Error on This Website: How to Fix It if you can't reach the dashboard).
- Loops that never finish, such as a redirect or rebuild that repeats forever. The error appears at every limit you try.
- A slow outside service, such as a payment, shipping or licence server that isn't responding.
- An overloaded account. If Metrics > Resource Usage shows limit hits, scripts slow down and time out. Caching helps a lot (How to Speed Up WordPress with LiteSpeed Cache).
Also note that the web server itself won't wait forever for a page. A request that runs for a couple of minutes can be cut off with a 504 Gateway Timeout (504 Gateway Timeout: What It Means and How to Fix It) even if max_execution_time is higher, so very large limits don't help tasks that run in a browser.
Run long jobs as a cron job instead
Big tasks -- huge imports, sending queued email, rebuilding search indexes, running backups -- are better run in the background than in a browser tab. PHP run from the command line has no execution time limit by default. Many plugins provide a command or URL meant for cron. Set it up in Advanced > Cron Jobs (How to Set Up a Cron Job in cPanel). If your site uses a PHP version other than the default, use that version's full PHP path in the cron command, as explained in the cron guide.
For WordPress imports, you can also split the file into smaller parts and import them one at a time. For database imports in phpMyAdmin, see How to Import and Export a Database with phpMyAdmin.
When to open a ticket
Open a ticket if the new limit won't apply, or a task keeps timing out after you've raised the limit to 300 seconds. Include the full error line, what you were doing when it happened, and roughly how long it ran before failing.
Related guides
- How to Change PHP Settings (memory_limit, upload_max_filesize)
- How to Set Up a Cron Job in cPanel
- 504 Gateway Timeout: What It Means and How to Fix It
- PHP Allowed Memory Size Exhausted: What It Means and How to Fix It
- How to Check Your Website Error Log and Recent Visitors
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
