Extending "max_execution_time" in PHP for Reliable Backups in WP Umbrella

Today we're tackling the "max_execution_time" setting in PHP – an essential parameter that dictates how long a script should run before it times out. Defaulted to 30 seconds, this setting is adequate for most tasks.

However, for more intensive jobs like backups or large data exports, a longer execution time may be necessary to prevent errors and ensure smooth operation.

In this guide, we delve into the "max_execution_time" setting in PHP and explain why tweaking this value is sometimes crucial, especially for executing comprehensive backup processes.

What is "max_execution_time"?

The "max_execution_time" setting is a critical PHP configuration directive that specifies the maximum time, in seconds, that a script is allowed to run before it is terminated by the parser. This helps prevent scripts from running indefinitely and potentially depleting server resources. The default setting is typically 30 seconds.

Why Increase "max_execution_time" for Backups?

Backups often involve the transfer and processing of large amounts of data, which can take longer than the standard execution time allowed by PHP.

When the "max_execution_time" is too short, it can lead to incomplete backups, missing data, or failed backup attempts, especially if your website is hosted on shared server.

By increasing the limit, you allow all processes involved in the backup to complete fully, ensuring a reliable snapshot of your site's data.

Prerequisites for Modifying Execution Time

  • Administrative access to your website's hosting control panel.
  • Understanding of your hosting provider's policies regarding PHP configuration changes.

How does our backup process works?

We've got a nifty custom backup process in place. We break down backups into small-sized batches - for both backups and databases. This way, we sidestep that pesky max execution limit

How to Modify "max_execution_time"

  1. Locate the PHP Configuration File (php.ini): The php.ini file is where you can change the "max_execution_time" setting.
  2. Adjust the Setting: Find the line max_execution_time = 30 and change the value from 30 to a higher number like 120 or 300 seconds, which are more suitable for backups.
  3. Save and Restart: Save the changes and restart your web server for the changes to take effect.

If you're not comfortable making these changes yourself or if your hosting setup restricts access to the php.ini file, please refer to your hosting provider's support documentation or contact their support team directly for assistance.

For detailed guidance, you may refer to documentation specific to popular hosting providers:


Things to Keep in Mind

  • Modifying server settings should be done cautiously. Ensure you have backups before making changes.
  • Test after making adjustments to confirm the backup completes as expected.
  • Hosting environments differ; some might not permit changes to "max_execution_time". Always consult with your provider.

By fine-tuning the "max_execution_time", you're setting the stage for a backup process that runs its course without unwelcome timeouts, safeguarding your website's data with complete backups.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us