PHP Memory Limit | Here’s how you can increase it in WordPress!

In an article on choosing the right hosting provider, the so-called PHP Memory Limit addressed. Some WordPress users experience problems after a certain period of time. For example after an update of the WordPress blog software, the installation of new plugins or a change of theme. The reason is that the PHP memory limit is too low.

The typical error messages:

Fatal error: Allowed memory size of XXXX bytes exhausted (tried to allocate XXXX bytes) in…”

or

“Out of memory (allocated XXXX) (tried to allocate XXXXX bytes) in…”

Explanation

When using PHP applications, a memory limit set. This limit describes the maximum (working) memory consumption that the entire blog (all PHP scripts) may cause on the server.

If one of the above error messages appears, a WordPress installation is trying to reserve more memory for itself than it is entitled to according to the server’s specific memory limit. The causes can be of different origins.

On the one hand, the WordPress software unfortunately takes up a little more storage space after each update. On the other hand, too many installed plugins or individual – extremely memory-hungry plugins – cause a high memory requirement. In addition, installing/deleting plugins several times or frequently changing the theme can result in “leftovers” on the server, which unnecessarily bloat a system.

To use:

WP Academy content

  • Internet entrepreneur training
  • Online private coaching
  • Certification and Award

WP Academy Button

Determine PHP memory limit

If you want to get clarity about the load on your server, you can install a small plugin like WP-Memory-Usage. After installation, it shows the blogger an overview of the WordPress installation on the dashboard memory usage on.

In order to find the effects of individual plugins on memory consumption, you can gradually deactivate some plugins and then compare the current memory requirement with the previous one.

WP-Memory-Usage128M

WP Memory Usage: Memory Limit = 128MB

As seen in the picture, All-Inkl.com provides its customers 128MB to disposal. This value is well above the minimum of 32MB formulated by WordPress. The unofficial minimum requirement of 64MB is also exceeded twice.

The picture also shows that How-to-Wordpress.de with about 15 installed plugins causes a memory usage of just 25%. So all in all fine.

It is also possible for All-Inkl.com customers to increase the memory limit 256MB to be increased, which should leave enough room for maneuver in the future. How to increase the PHP memory limit on other servers is explained below.

Increase PHP memory limit

Possibility Number 1:

You open that root directory his blog and opens the file: “.htaccess

Then add the following line:

“php_value memory_limit 256M”

256M logically stands for a memory limit of 256MB. Depending on the memory requirements of your own blog and the specifications of the server, values ​​such as 128M or 64M can also be tried.

.htaccess php memory limit

.htaccess: Memory Limit = 256MB

Doesn’t already exist in the root of the blog “.htaccess‘ you can easily create it yourself. All you have to do is create a file with the exact name “.htaccess‘ are created containing the above line. It is then uploaded to the root directory.

Possibility 2:

By making an entry in the file “wp-config.php“ of the blog directory, the limit can be increased. To do this, the following line must be inserted at the beginning of the code:

“define(‘WP_MEMORY_LIMIT’, ‘256M’);”

As usual, 128 or 64 can be entered instead of 256.

wp-config_defineWPMemoryLimit

wp-config: Memory Limit = 256MB

Possibility 3:

This creates a file called “php.ini“ is created, which in turn is uploaded to the WordPress directory. The file can be created again with a text editor, whereby the following line must be included:

memory_limit=256M

Conversion Plugins: Flytools

flytools

Benefits:

Flytool advantages

  • Ideal for creating webinar or membership pages
  • Create high-conversion buttons quickly and easily

control

If the rewriting or creation of the files worked, WP-Memory-Usage shows the set value. Here: 256MB

WP-Memory-Usage256M

WP Memory Usage: Memory Limit = 256MB

Which of the methods presented work with the respective hoster must be tried out individually. Depending on the hoster, it may not be possible to manually increase the PHP memory limit at all. In this case, the only option left is to talk to the hoster and, if necessary, switch to another provider.

Rate this article

4 Rating(s), average: 5.00 of 5 Loading…

Previous post Change WordPress maximum upload size? (HTML, PHP, Web)
Next post STRATO doubles the PHP memory limit