This article covers solutions to PHP timeout issues with WordPress sites.
For performance reasons, we set the PHP
max_execution_time on our shared servers quite low, usually 60 seconds. For some operations this might be too low and could lead to timeout errors.
Most commonly this will happen when running a backup with a WordPress backup or migration plugin. Small sites will rarely have a problem with this, but if a site is quite large (several hundred MB or more) this is more likely to occur. This is because the PHP process runs out of time (as determined by the
max_execution_time) before it can complete.
Some WordPress backup plugins workaround this limitation by performing the backup across multiple PHP calls, rather than needing to complete the entire backup in a single process. BackupBuddy is one such plugin that has this feature and this is one of the reasons we recommend it.
Adjusting the PHP max_execution_time
You can modify the PHP
max_execution_time for your site by overriding the default value with the
.user.ini configuration file.
You can create a
.user.ini file a number of different ways, but for this tutorial we're going to use the Plesk File Manager. We're going to set the
max_execution_time to 600 seconds (5 minutes).
- Login to the Plesk Panel.
- To to the Plesk File Manager by clicking the Files tab.
- Navigate to the webroot of the site you wish to work with, usually
- From the Plesk File Manager menu, select Create New File.
- The Create A File dialog will open. Name the file
.user.iniand click OK.
.user.inifile will now be listed in the directory.
- Click the
.user.inifile to view it.
- Click the Edit in Text Editor button at the bottom of the page.
- Add the following to the file, exactly like this:
- Click Save.
- Click OK to exit the Text Editor.
That's it! Your PHP
max_execution_time is now 600 seconds, which should be long enough to backup a large site or perform other lengthy PHP operations, such as recreating image thumbnails.
If you experience any issues with this, or have any questions, just open a support ticket and we'll be happy to help