Some WordPress users may have encountered problems updating or problems publishing articles, and raised notifications like the following (“Fatal Error: Maximum Execution Time Exceeded in WordPress“).
If you are currently experiencing a problem like this and are looking for a solution to solve it, then here I will provide a tutorial on how to fix the Maximum Execution Time Exceeded WordPress error with several methods that you can try one by one so that the problem can be resolved properly. But before entering into the tutorial, we should first know what causes the Maximum Execution Time Exceeded.
What is the Maximum Execution Time Exceeded Error?
Maximum Execution Time Exceeded Error sometimes occurs when you are updating or updating themes, installing plugins, downloading applications or some other operation on your site. The main cause of this problem is that the execution time exceeds the default value.
By default, the PHP system’s maximum execution time is 30 seconds. If the PHP script takes more than this time, it will produce a maximum execution time error. Thus, if you experience this problem, of course the solution is to increase the execution time limit.
Fixed the Maximum Execution Time Exceeded Error
The preferred method of fixing this fatal error is to manually change the maximum execution time value. There are three files that you can use to solve this problem, namely the .htaccess file, the wp-config.php file and the php.ini file.
Open the .htaccess file using an FTP client. Here, we will do the following steps via cPanel, which is the most powerful control panel for website management. Log in to cPanel with your account and then go to File »File Manager.
Search for files .htaccess from the file list and right click »edit. If the file editor has opened .htaccess then you must add the following code.
php_value max_execution_time 120
You are allowed to modify the values you want. Example like the code above which means you have increased the maximum execution time to 120 seconds. Next, please save and try whether the fatal Maximum Execution Time Exceeded error still appears.
The wp-config.php file is one of the most important files in WordPress which contains various configurations to make your website more functional. In the case of Maximum Execution Time Exceeded Error this file can also act as a solution for you. To find the wp-config file in the same way you search for the .htaccess file, you will need to go to File »File Manager and open the wp-config.php file in the editor. And then, add the following code to the editor and click “Save” to confirm the changes.
Note that, the number “60” means that you have set the maximum execution time to be 60 seconds, which you can change as needed.
Open the php.ini file or you can also create a new file via cPanel »File» File Manager »New file. And then, add the following code to the php.ini file and change the values according to your own needs. If you have, please save the php.ini file, here is the code that you can enter.
max_execution_time = 120;
WordPress has released a large number of plugins as solutions for various purposes and there are also plugins to fix the Maximum Execution Time Exceeded Error. If you don’t like using the manual method above and are afraid to use code, you can use the WP Maximum Execution Time Exceeded plugin.
To use it, find and install the plugin WP Maximum Execution Time Exceeded through WordPress Dashboard »Plugins» Add New. And then, activate this plugin and make the plugin work for your website properly. Since you have installed and activated this plugin, the maximum execution time has been automatically changed to 300 seconds in real time.
The above are some of the ways that you can use to increase PHP execution time, so that the Fatal Maximum Execution Time Exceeded on your WordPress site doesn’t appear again, and please try. Hopefully this is useful 🙂