If you are getting an error “the allowed memory size limit exhausted” in your WordPress website, that means you are in a trouble. Your website can’t be open by any visitor in this world. It may be a bad impression on your visitors. It can also effect your online business. But you don’t worry about anything else after reading this blog. I am sharing with you very easy steps to fix this issue.
What is PHP Memory Limit?
PHP is a type of language to design web programs. It is a programming language to design dynamic and unique web pages. WordPress is also written in PHP programming language. PHP is server side scripting language. When a user allows a web page to work with PHP codes. It automatically generates HTML output to be displayed on the browser screen on the computer.
PHP Memory limit is a RAM of your website. Every WordPress website needs a website server hosting. These web servers are something just like a computer. They also need memory to run a website and its applications.
A new WordPress website hosting provider makes a memory limit for their users. You have to increase that limit if you want. When you have crossed the memory limit to run your website. You will be seeing an error when visiting your website. This error may be something like this.
Fatal error: Allowed memory size of 33445532 bytes exhausted (tried to allocate 2483617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line 256
This error will show on your website page when you will try to open it. I will tell you today very easy steps to fix this issue.
Easily Increasing PHP Memory Limit in WordPress
In your WordPress site root folder, there is a file named wp-config.php. You can use cpanel to find your root folder into the file manager. If you don’t have access to cpanel. Then you should use FTP file manager to resolve this issue.
After that, You will have to paste a code into the wp-config.php file. You need to enter in this wp-config.php file and find out the line “That’s all, stop editing! Happy blogging”. If yo can’t find out the line, tap Ctrl+F and type these words and enter the search button. You will get these lines. Now paste the code just above the line “That’s all, stop editing! Happy blogging” and save the file as it is.
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
This will increase your WordPress site PHP memory limit to 256 MB.Now, You can visit your website and the error has gone. This may be good news that your site is again running up.
IMPORTANT: If your site is showing still this error, it means you hosting provider is not allowing WordPress to increase the memory limit. Now you should talk to your web host technical support team to solve this issue for you.
If you get helped by this article. It’s our pleasure to make you happy. You may also like our another blog How to Fix An Error Establishing a Database Connection.