If you are seeing “Fatal Error Maximum Execution Time Exceeded” when accessing your WordPress website. This error is normally caused when the part of your WordPress code is taking too long to execute and reaches the maximum time limit set by your WordPress hosting.
In this article, we will demonstrate how “Fatal Error Maximum Execution Time Exceeded” is caused on your WordPress website and some ways to fix them.
How is “Fatal Error Maximum Execution Time Exceeded” Caused on WordPress?
WordPress is coded mainly using the PHP programming language. To protect the server from abuse, a time limit is set for how long a PHP script can run. The actual time limits vary across hosting companies. However, most of the times the maximum execution time is set between 30 – 60 seconds because it is usually a good run for a good PHP script to run.
However, when the script reaches the maximum execution time limits, maximum time exceeded error is displayed on your site screen.
Fixing Fatal Error Maximum Execution Time Exceeded Error
Although, Maximum Execution Time Exceeded Error is named a “fatal error”, it is one of the common errors that occurs in WordPress and you can easily resolve this.
Depending on how the error is triggered, WordPress might show the error message to the site visitors.
The simple solution to this issue is to manually editing the .htaccess file and adding a single line of code to increase the maximum execution time of your site.
To find the .htaccess file of your website, login to the cPanel of your website. The login information of your cPanel is provided by your web host when you create an account.
Now, click on the File Manager option. The File Manager will allow you to access all the files related to your website.
Click on the public_html directory.
You can see the wp-content and wp-admin folders. Locate the .htaccess file. Now, right click the .htaccess file and select the Edit option.
If you cannot locate the .htaccess file on the cPanel, click on Settings on the top right of your screen and check “Show Hidden Files (dotfiles)” and click on Save.
Once you have clicked on the edit button of .htaccess, a popup will show up with a warning to create a backup of your files before editing anything. The backup file will ensure that you can revert your website back to when it was working if something goes wrong.
Click on the “Edit” button. A new tab will open which contains all the codes from the file.
Now, add the following line of code to your .htaccess file:
php_value max_execution_time 300
Once you have inserted the code in the file, click on “Save Changes” to finish.
If you are still getting the error, try increasing the value to 600.