Documentation

How to raise maximum execution time in WordPress?

One of the server's security measures is setting a time limit for PHP processes, known as the maximum execution time. This limit allows the server to terminate a PHP process once it exceeds the configured time limit. Unfortunately, complex processes triggered by some WordPress plugins or software updates may exceed this limit and fail to complete.

If you see the following message in the dashboard or the debug.log file after starting an update or another process, such as the one shown below:

Fatal error: Maximum execution time of 5 seconds exceeded in
Don't panic! :) This problem can be frustrating, especially for less experienced WordPress users, but it is usually easy to fix. Below is a way to deal with it.

.htaccess changing#

1. Connect to your FTP server using FileZilla, Total Commander, or another FTP client.
You can find the .htaccess file in the root directory of your site. This is the same directory where wp-content and wp-admin folders are located.
2. Open the file and add the following line:
php_value max_execution_time 300
3. Save the file and make sure that the change has been made.

The code above sets the maximum execution time for PHP processes to 300 seconds. If the error persists, try increasing the value to 600 seconds.

There is no .htaccess in any directory#

If you cannot find the .htaccess file, it may not have been created yet.
To create a file and the change described above, go to your Settings > Permalinks in your WordPress, then click Save Changes
Htaccessen
After you save the settings, WordPress may create an .htaccess file, which you can edit as described above.

Not the solution you are looking for?

Please check other articles or open a support ticket.