Fix WordPress "Memory Exhausted" Error by Increasing PHP Memory Limit

Dieser Artikel steht Ihnen im Moment auschließlich auf Englisch zur Verfügung

Introduction

Learn how to fix the WordPress "Allowed memory size of ____ bytes exhausted" error by increasing the PHP memory limit on your 1&1 Cloud Server running Linux.

Requirements

  • A 1&1 Cloud Server running Linux (any distribution).
  • WordPress and LAMP stack (Apache, MySQL, and PHP) installed and running.

Increase the PHP Memory Limit

To increase the PHP memory limit, you will need to edit your site's wp-config.php file. This file is located at your WordPress installation's root directory. Edit this file, for example with the command:

sudo nano /var/www/html/wp-config.php

Add the following lines to the file, above the line which reads // ** MySQL settings - You can get this info from your web host ** // :

/** Increase PHP memory limit */
define( 'WP_MEMORY_LIMIT', '256M' );

This will increase the memory limit to 256MB. You can customize the number to increase the memory limit to a higher amount if you wish.

Save and exit the file. Visit your site in a browser. The "memory exhausted" error will be gone. If the error is still occurring, you may need to increase the WordPress memory limit to a higher number, and/or increase the size of your server itself.

Diskutieren Sie mit!

Die 1&1 IONOS Community – Hosting-Wissen von Experten für Ihren Erfolg.