Hi Guys, Today I am Going to Show You How to Fix “Fatal Error Allowed Memory Size of bytes Exhausted (tried to allocate bytes)”in WordPress?
Are you Looking for the Commonly Searched WordPress Error “How to Fix “Fatal Error Allowed Memory Size of bytes Exhausted (tried to allocate bytes)”in WordPress?” (or) “How to Increase Php Memory Limit in WordPress?”.Here is the Solution to Fix this Common Issue That has been faced by most of the WordPress Users including myself.
Let’s See about How to fix this issue?
Check Out This: How to Transfer a Domain Easily from One Registrar to Another (In 3 Steps)? | Step-By-Step Domain Transfer Tutorial
Steps For How to Fix “Fatal Error Allowed Memory Size of bytes Exhausted (tried to allocate bytes)”in WordPress?
Method 1: Increase the Memory Limit Manually
1. If you have access to your PHP.ini file, Try to change the Memory Limit Value in PHP.ini File.
If the Memory Limit is set to 32M by Default then Change it to 64M,128M,256M)
memory_limit = 32M —> memory_limit = 64M
2.If you don’t have access to PHP.ini File, Add the Below Line to a .htaccess file:
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
php_value memory_limit 256M
php_value upload_max_filesize 128M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_time 300 php_value memory_limit 256M
If the Memory Limit is set to 32M by Default then Change it to 64M,128M,256M)
Method 2: Change the Memory Limit Value to Different Value
Just Look for the Below Given Lines and Try to Change the Memory Limit Values
ini_set(‘memory_limit’, ‘512M’);
(or)
php.ini => memory_limit = 128M
(or)
php_value memory_limit 128M
ini_set('memory_limit', '512M'); (or) php.ini => memory_limit = 128M (or) php_value memory_limit 128M
Save the File and Refresh the Website.
Method 3: Change the Memory Limit Value to Unlimited (Full memory)
Step 1: First of all Go to Your Web Hosting Site and Log into Your CPanel (HPanel).
Step 2: Navigate to PHP Section and Change Memory Limit to -1.
(Or)
Step 2: Try to change the Memory Limit Value in PHP.ini File.
ini_set(‘memory_limit’, ‘-1’);
ini_set('memory_limit', '-1');
*Note – ( -1 = Unlimited Memory)
Step 3: Save the File and Refresh the Website.
Method 4: Adding a code in the wp-config.php file
Step 1: First of all Go to Your Web Hosting Site and Log into Your CPanel.
Step 2: Navigate to File Manager and Open Public_Html Folder.
Step 3: Now Right Click on the Wp-Config.php File and Click Edit Option to Edit the Wp-Config.php File.
Step 4: Add this Piece of Lines into the Wp-Config.php
define( ‘WP_MAX_MEMORY_LIMIT’, ‘512M’ );
define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); define( 'WP_MEMORY_LIMIT', '512M' );
Step 5: Save the File and Refresh the Website.
Method 5: Upgrade Your PHP Version
Just go to your Hosting CPanel and Upgrade your PHP version to 7.1 and above.
Method 6: Contact Your Host
Contact your Hosting Company’s Help Service and Ask them to Increase the Memory Limit.
Method 7: Upgrade Your Site Hosting Plan
If you are on a Shared Web Hosting Servers, Just Upgrade Your Website Hosting to Some Good Hosting plans/Servers like VPS or Dedicated Hosting Servers.
Note – If you have More than 2 -3 Lakh Views Per Month, You must Definitely Update to VPS Hosting Services.
For a Large Number of Viewers, You Just Need a Dedicated Hosting Server.
That’s It! You’re Done Man!
That’s All About this Post. Give Your Reviews / Reactions about this Post and Leave Comments, Ask Your Doubts, We are here to Help You!