Home / Blog / Web Development

Web Development

Fix WordPress Fatal Error: Maximum Execution Time of 30 Seconds Exceeded

Uploading a big theme or importing data and hitting a fatal timeout error? Raise the PHP execution time limit.

In this article
  1. The cause
  2. The solution
  3. Other options
  4. Universal fix
  5. Frequently asked questions

The error "Fatal error: Maximum execution time of 30 seconds exceeded" often appears when you upload a theme, import data or run a long task in WordPress. It is frustrating, but the fix is simple.

Key takeaways

  • PHP stops scripts that run longer than max_execution_time.
  • Raise the value in php.ini (or .htaccess or your hosting panel).
  • Restart the web server after changing php.ini.
  • Avoid 0 (unlimited) on live sites. Use a value like 300.

The cause: PHP execution time limit

PHP gives each script a default time allowance, often 30 seconds. If a task, such as uploading a large theme file or importing demo content, runs longer than that, the server stops it and shows a fatal error.

The solution: raise the limit in php.ini

Edit php.ini and increase max_execution_time:

max_execution_time = 300

A value of 0 means unlimited. It works, but it is risky on a live site because runaway scripts can hang the server, so prefer a number such as 300 (5 minutes).

Other places to set it

  • .htaccess (Apache with mod_php): php_value max_execution_time 300
  • wp-config.php: add set_time_limit(300); near the top.
  • Hosting control panel: many hosts have a PHP settings page.

Works for any PHP application

The same fix applies to any script that reports a maximum execution time error, including custom PHP apps, Joomla and Drupal.

  • Find the php.ini file, often in the root directory or /etc/.
  • Search for max_execution_time.
  • Set it to a higher number such as 300.
  • Restart Apache or Nginx (or PHP-FPM) so the change takes effect.

Still stuck? Our WordPress and web development team can help.

Frequently asked questions

Is it safe to set max_execution_time to 0?

It removes the limit, which can let faulty scripts run forever. On live sites use a high but finite value.

Why do I still see the error after changing php.ini?

The web server or PHP-FPM needs a restart, or your host overrides the setting. Check your hosting control panel.

The Ucodice Team is a group of passionate developers, designers and strategists delivering web, mobile and software solutions to clients worldwide.

Ready to take the next step?

Explore our web development services or tell us about your project. A senior member of our team will get back to you with clear next steps.

Let's start your project

Tell us what you want to build or grow. We'll reply within one business day with clear next steps.

Phone: 9560430495  ·  Email: contact@ucodice.com

Office: Ucodice Technologies, IHDP Business Park, Street Number 7, Sector 127, Noida, Uttar Pradesh 201304. Also serving Delhi NCR and clients worldwide.

Trusted and certified

Free consultation

Tell us about your project.

Get a free quote