Have you had an error in WordPress that says "Fatal Error: Maximum Run Time Exceeded" each time you try to run a task such as updating a theme or plugin in WordPress? Do not worry. You're not alone. Many WordPress users have encountered this error while performing various tasks and when updating WordPress or plugins.
This is a common mistake that can be easily corrected. In this article, we will show you two simple methods to correct it and guide you through the process with step-by-step instructions.
First, let's see what caused this error in the first place.
In order to understand what this error consists of, you need to understand how WordPress works. As you may know, WordPress is developed with PHP and WordPress uses some PHP scripts to perform specific functions in the system. For example, when updating WordPress to a newer version, it runs scripts to perform tasks such as updating databases.
Sometimes, when WordPress runs these scripts, it can take an unusually long time. Like when you try to update WordPress during a rush hour when your website is filled with traffic. This often leads to increased use of server resources.
For example, to prevent websites from abusing server resources, web hosting providers set a time limit for running a script. When this time is exceeded while running a script, the error message "Fatal Error - Maximum Execution Time Exceeded" is displayed.
There are two basic ways to fix the fatal error: Allowable memory size of bytes that are exhausted in WordPress. You can increase the WordPress memory limit or delete the script that requires more memory. Check out our beginner's guide below:
1. Increase PHP Memory Limit in WordPress – the Easy Fix
This error indicates that your site is out of memory. The obvious solution is to increase the amount of memory that can be allocated to a script.
By design, WordPress first tries to increase your memory limit to 64 MB. Seeing this error, this size is still not enough or, in some cases, your server prevents the allocation of more memory .
- You can manually increase the memory limit in WordPress by editing the wp-config file.
- Once connected, the folders and files of your site will be displayed at the bottom right of your screen. Find the folder containing all your WordPress files and double-click to open it.
- Main WordPress Folder - Corrected Allowed Memory Size Exhausted in WordPress
- In this folder, locate your wp-config file, right-click it, and click View / Edit.
- Edit wp-config - correction of the allowed memory size in WordPress
- When the file opens in your text editor, scroll down to find the line "That's it, stop editing!" Happy blogging. "Paste the following code above this line.
- define ('WP_MEMORY_LIMIT', '128M')
- Add code to increase PHP memory - correction of the allowed memory size in WordPress
- Save this file and close the editor. FileZilla will ask you to download the modified file. Click yes.
- Reload your site now. The problem should be resolved and your site should display correctly.
Alternate Solution – Find the Script Causing the Error
The above solution can help you solve this problem quickly. But there are situations where it is better to find the script that requires more memory and delete it.
- If, for example, you need to increase the memory allocated above 256 MB, this script already uses too much memory. This could ruin the performance of your site.
- In some cases, your host may not allow you to increase memory. If this is the case for you, the quick fix above will not solve the problem. In this case, you can contact your host and ask them to increase the memory. Or better yet, you can locate the greedy script in memory and get rid of it.
- The first place you want to look for this script is your plugins. If you have installed a WordPress plugin shortly before this error, it is probably the cause.