While updating themes or installing plugins you can get a fatal error known as Maximum Execution Time Exceeded error. This error blocks you from updating or installing any new themes and plugin and interrupts you from performing any other operations in your website. So in this post, I will show steps to fix fatal Error Maximum Execution Time exceeded in WordPress.
Why Maximum Execution Time exceeded occur in WordPress?
This error is the result of a security precaution taken by WordPress. By default, WordPress has set a time limit for running PHP script. When the execution of PHP script exceeds the time limit, this gives you the Maximum Execution Time Exceeded Error.
Fix Fatal Error Maximum Execution Time exceeded in WordPress
The fix is to expand the default time limit for execution of a process. This error occurs when updating a theme, installing plugin, downloading an application or performing some other operation in website. By default maximum execution time of PHP system is 30 seconds. The recommended fix is to manually increase the execution time. There are 3 files available in WordPress from where you can increase execution time. The three files are .htaccess, wp-config.php, and php.ini files. There is no need to make changes in all three files as action in any one of these files will do the job. Before performing any action keep back up of files you are about to edit. Let us see how to make changes in all three files:
Using htaccess file
Adding a single line of code in the htaccess file can help you get rid of Maximum Execution Time exceeded Error. Follow these steps to use htaccess file for removing error.
- Connect to your website using FTP or cPanel.
- Find htaccess file which is located in any folder as /wp-content/ or /wp-admin/
- Add this line in your htaccess file.
Php_value max_execuion_time 300
- Finally save the file.
The above code will set value for maximum execution time to 300 seconds or 5 minutes. If you still get error increase the value of execution time to something higher.
By wp-config.php changes
This wp-config file can be easily found in the root location of your WordPress installation. It is a very important file so be very careful while editing this file. You can add the following code in the file to increase the execution time.
The above code sets the value to 300 seconds.
If you already have a php.ini file in your installation folder, just open the file and add below mentioned code. If you don’t have php.ini file you can create it yourself. Just create a text file and name it php.ini and add the code given below.
Save the changes and upload it in the root folder of WordPress installation files
If you don’t want to mess around the codes or don’t want to explore through files structure then you can use a plugin to do this task. Using plugin is the safest way available for removing this error and this will save you from a lot of troubles. You can use a plugin called WP Maximum Execution Time Exceeded. This is a simple and effective plugin.
Follow these steps to add the plugin to your website
- Login to your admin dashboard
- Navigate to Plugin > Add New
- In the Add Plugins page, find and activate the plugin called WP Maximum Execution Time Exceeded.
The plugin will automatically increase the maximum execution time limit to 300 seconds. This plugin simply uses the .htaccess file to solve the problem. When WP Maximum Execution Time Exceeded is activated after installation, the plugin will automatically write the necessary code to the .htaccess file. To delete the code, simply deactivate the plugin. There is no any administration page.
We hope the article was helpful for you to fix fatal Error maximum execution time exceeded in WordPress.
Latest posts by Kantiman Bajracharya (see all)
- What are Different WordPress Theme Licensing Terms? - December 21, 2017
- 4 Tips to Optimize Your WordPress for Social Media Share - November 30, 2017
- What is WordPress? Is WordPress Free? Why is WordPress so popular? - November 22, 2017