PHP Maximum Execution Time Exceeded: What It Means and How to Fix It

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

  1. Log in to cPanel and go to Software > MultiPHP INI Editor.
  2. On the Basic Mode tab, choose your domain under Configure PHP INI basic settings.
  3. Find max_execution_time and enter a higher number of seconds, for example 120. For large imports you can go up to 300.
  4. If the task involves uploading a big file, raise max_input_time to the same value.
  5. 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_time line in .htaccess, or a php.ini or .user.ini from a previous host, and remove it. (php_value lines in .htaccess can 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

Still stuck? Open a support ticket and the Instant Access Internet Services team will help.

Ultrafast LiteSpeed hosting from InstantAccess.net: free SSL, free backups, cPanel included, no contracts. Check out our $10/month hosting.
  • maximum execution time exceeded, maximum execution time of 30 seconds exceeded, increase max_execution_time cpanel, php timeout error, wordpress maximum execution time, max_execution_time
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

429 Too Many Requests: What It Means and How to Fix It

A 429 Too Many Requests error means something decided that one visitor, program or website sent...

500 Internal Server Error: What It Means and How to Fix It

A 500 Internal Server Error means the web server hit a problem it couldn't recover from while...

400 Bad Request Error: What It Means and How to Fix It

A 400 Bad Request error means the server received a request it couldn't understand, so it refused...

401 Unauthorized Error: What It Means and How to Fix It

A 401 Unauthorized error means the page you asked for needs a login, and the server didn't...

403 Forbidden Error: What It Means and How to Fix It

A 403 Forbidden error means the server understood the request but refused to show the page....