One of the server security is setting a time limit for WordPress/ PHP processes so-called Maximum Execution Time. This limit means that the PHP process will cancel after reaching the assumed time by the process. Unfortunately, in the case of complicated processes triggered by some WordPress plugins or even software updates, it turns out that the limits are set too low and the processes are not finished. The article covers how to increase the PHP max_execution_time parameter for higher script execution time in WordPress.
Contents
The PHP max execution time issue?
If in the dashboard or debug.log file you will see the message, after launching an update or other like this one:
Fatal error: Maximum execution time of 5 seconds exceeded in
Don't panic 😊 The problem can be frustrating, especially for less experienced WordPress users - but it is very easy to repair. Below is a way to deal with it.
How to increase the PHP max_execution_time limit for WordPress?
Edit the .htaccess file
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 are located wp-content and wp-admin are located.
2. After opening the file, add the following line to it:
php_value max_execution_time 300
3. Save the file and make sure that the change has been made.
The code above sets the value of the maximum execution time of the WordPress/ PHP process for 300 seconds. If the error still appears, try to simply increase the value, e.g. up to 600.
There is no .htaccess in any directory
If you have not found the .htaccess file, it may not have been generated by your website yet.
To create a file and make the change described above, go to your Settings > Permalinks in your WordPress, then click Save Changes
After saving the settings WordPress will create a .htaccess, which you can modify according to the above instructions.
WP Desk Plugins →