Through this tutorial, you will learn how to fix fatal errors: allowed memory size of 8388608,16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824 bytes exhausted (tried to allocate x bytes) in /home/site/public_html/wp-content/plugins , /wp-include, /wp-admin wordpress.
How To Fix fatal error: allowed memory size of x bytes exhausted wordpress
Here are some methods to fix fatal errors: allowed memory size of 8388608,16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824 bytes exhausted (tried to allocate x bytes) in /home/site/public_html//wp-content/plugins, /wp-include, /wp-admin wordpress.
- Method 1: Edit the
wp-config.php
file - Method 2: Edit
php.ini
- Method 3: Edit the
.htaccess
file
Method 1: Edit the wp-config.php
file
Visit your WordPress root directory and find the directory of the
file. Then open it and add the following line of code into it:wp-config.php
define( 'WP_MEMORY_LIMIT', '1024M' );
Method 2: Edit php.ini
Now, you need to open php.ini file and add the line “memory_limt =” with limit; is as follows:
ini_set('memory_limit', '1024M'); //
Method 3: Edit the .htaccess
file
Visit your WordPress root directory and find the directory of the
file. Then open it and add the following line of code into it:.htaccess
php_value memory_limit 256M