How to Increase PHP Memory Limit of Your WordPress Website

You might find your WordPress website in need of more PHP Memory limit. The most common error you’ll encounter which points to the lack of PHP Memory limit would look like this:

Fatal error: Out of memory (allocated a certain number of bytes) (tried to allocate more bytes) in /absolute/path/to/one-of-the-WordPress-files/on-your-site.php on one line

You Can Fix This!

Fix-it Felix

There are a couple of things you can do in order to increase the PHP Memory limit of your site and fix this problem:

  • Increase your WordPress PHP Memory limit by adding the following line to wp-config.php:

          define('WP_MEMORY_LIMIT', '256M');

  • If your hosting provider allows editing and overriding the system php.ini file, you can increase the memory limit there directly. Just add the following line to php.ini or increase the value if the line already exists:

          memory_limit = 256M

  • If you cannot override the system php.ini file, you can modify .htaccess and  add the following line to it:

          php_value memory_limit 256M

  •  If none of the aforementioned solutions worked, I suggest pinging your hosting provider and asking them for assistance in increasing the PHP Memory limit of your site.

Hope this article will be useful  🙂

%d bloggers like this: