Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Fix: WordPress Memory Exhausted Error – PHP-Speicher erhöhen

Hinweis der Redaktion: Wir erhalten eine Provision für Partnerlinks auf WPBeginner. Die Provisionen haben keinen Einfluss auf die Meinung oder Bewertung unserer Redakteure. Erfahre mehr über Redaktioneller Prozess.

Sehen Sie eine Fehlermeldung in WordPress, dass die zulässige Speichergröße erschöpft ist?

Dies ist einer der häufigsten WordPress-Fehler, und Sie können ihn leicht beheben, indem Sie das PHP-Speicherlimit in WordPress erhöhen.

In diesem Artikel zeigen wir Ihnen, wie Sie den Fehler „WordPress memory exhausted“ beheben können, indem Sie das PHP-Speicherlimit erhöhen.

Fix: WordPress Memory Exhausted Error – Increase PHP Memory

Was ist der WordPress Memory Exhausted Error?

Der WordPress-Fehler „Speicher erschöpft“ ist eine Meldung, die Sie sehen können, wenn Ihre Website Probleme hat, Aufgaben auszuführen.

WordPress basiert auf PHP, einer serverseitigen Programmiersprache, die zur Ausführung Speicher benötigt.

Wie jeder andere Computer haben auch Webserver nur eine begrenzte Menge an Speicherplatz, um mehrere Anwendungen gleichzeitig auszuführen. WordPress-Hosting-Anbieter weisen den verschiedenen Anwendungen, einschließlich PHP, bestimmte Speichergrößen zu.

Wenn Ihr WordPress-Code mehr Speicher benötigt als der standardmäßig zugewiesene Speicher, wird diese Fehlermeldung angezeigt:

Schwerwiegender Fehler: Erlaubte Speichergröße von 33554432 Bytes erschöpft (versucht, 2348617 Bytes zuzuweisen) in /home4/xxx/public_html/wp-includes/plugin.php auf Zeile xxx

Memory exhausted error displayed on a WordPress site

Ihre WordPress-Website kann den Speicher des Servers auslasten, wenn dies der Fall ist:

  • Viele Bilder, Videos und andere Arten von Medien
  • Viele ungenutzte WordPress-Plugins
  • Die Ressourcen des Hostingplans sind überschritten

Standardmäßig versucht WordPress automatisch, das PHP-Speicherlimit zu erhöhen, wenn es weniger als 64 MB beträgt. Allerdings sind 64 MB oft nicht hoch genug.

Sehen wir uns also an, wie man das PHP-Speicherlimit in WordPress leicht erhöhen kann, um den Fehler „Speicher erschöpft“ zu vermeiden.

Sie können die nachstehenden Links verwenden, um durch das Lernprogramm zu navigieren:

Hinweis: Bei einigen dieser Methoden müssen Sie Ihre WordPress-Dateien direkt bearbeiten. Wir empfehlen Ihnen, zunächst eine Sicherungskopie Ihrer Website zu erstellen, um zu vermeiden, dass weitere Fehler auf Ihrer Website erscheinen.

Option 1: Bearbeitung der Datei wp-config.php

Zunächst müssen Sie die Datei wp-config.php auf Ihrer WordPress-Website bearbeiten. Dies ist eine der wichtigsten WordPress-Dateien, die sich im Stammverzeichnis befindet und in der Regel public_html heißt.

Sie müssen einen FTP-Client wie FileZilla oder den Dateimanager in Ihrem Webhosting-Kontrollzentrum verwenden.

Als Nächstes müssen Sie die folgende Zeile in die Datei wp-config.php einfügen, und zwar direkt vor der Zeile, in der es heißt: That's all, stop editing! Viel Spaß beim Bloggen.

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

Dieser Code weist WordPress an, das PHP-Speicherlimit auf 256 MB zu erhöhen.

Weitere Details finden Sie in unserer Schritt-für-Schritt-Anleitung, wie Sie die Datei wp-config.php finden und bearbeiten können.

Sobald Sie fertig sind, müssen Sie Ihre Änderungen speichern und die Datei wp-config.php wieder auf Ihren Server hochladen.

Sie können nun Ihre WordPress-Website besuchen, und der Fehler mit dem erschöpften Speicher sollte verschwunden sein.

Option 2: Bearbeiten der .htaccess-Datei

Die nächste Methode ist die Bearbeitung der .htaccess-Datei. Diese Datei befindet sich ebenfalls im Stammverzeichnis der WordPress-Website.

Hier müssen Sie den folgenden Code vor der Zeile mit der Aufschrift #END WORDPRESS einfügen.

php_value memory_limit 256M

Ähnlich wie beim vorherigen Code wird WordPress angewiesen, das PHP-Speicherlimit auf 256 MB zu erhöhen.p

Danach speichern Sie einfach Ihre Änderungen und laden die Datei wieder auf Ihren Webserver hoch. Sie können nun Ihre WordPress-Website erneut öffnen, um zu sehen, ob der Fehler mit dem Speicherlimit verschwunden ist.

Wenn Sie die .htaccess-Datei nicht finden können, lesen Sie unsere Anleitung, warum die .htaccess-Datei fehlen könnte und wie Sie sie finden.

Option 3: Überprüfen Sie Ihre php.ini-Datei

Wenn die oben genannten Methoden nicht funktionieren, sollten Sie sich Ihre php.ini-Datei ansehen.

php.ini ist eine Datei, die Ihre PHP-Einstellungen steuert, einschließlich der PHP-Version und PHP-Skripte. Es handelt sich dabei nicht um eine WordPress-Kerndatei, da sie normalerweise von Ihrem Hosting-Anbieter verwaltet wird.

Sie können den Code der Datei überprüfen, um zu sehen, wie viel PHP-Speicher Sie benötigen. Weitere Einzelheiten finden Sie in unserer Anleitung zum Auffinden und Bearbeiten der Datei php.ini.

Da es sich hierbei jedoch um eine fortgeschrittene Methode handelt, empfehlen wir Ihnen, sich stattdessen an das Support-Team Ihres Webhosting-Anbieters zu wenden, um herauszufinden, ob das WordPress-Speicherlimit manuell erhöht werden kann. Andernfalls kann dies zu weiteren Fehlern führen.

Weitere Informationen finden Sie in unserem Leitfaden für die richtige Anfrage an den WordPress-Support.

Option 4: Upgrade Ihres WordPress-Hostings

Wenn Sie ständig die Fehlermeldung „Speicher erschöpft“ erhalten, könnte dies ein Zeichen dafür sein, dass Ihre Website nicht mehr mit dem aktuellen Hosting-Angebot kompatibel ist.

Je mehr Besucher Ihre Website anzieht und je mehr Inhalte sie enthält, desto mehr Ressourcen benötigt sie, um reibungslos zu funktionieren. Ein Upgrade auf einen Tarif mit einer höheren Speicherzuweisung kann eine dauerhafte Lösung sein.

Erwägen Sie ein Upgrade Ihres WordPress-Hostings, wenn:

  • Sie haben die vorherigen Lösungen ausprobiert und der Fehler bleibt bestehen.
  • Ihre Website hat deutlich an Traffic oder Inhalt zugenommen.
  • Sie planen, Funktionen hinzuzufügen, die mehr Ressourcen erfordern.

Bluehost bietet erschwingliche und zuverlässige WordPress-Hosting-Angebote, die mit den Anforderungen Ihrer Website skaliert werden können. Sie bieten eine benutzerfreundliche Plattform, die speziell für WordPress optimiert ist und die Verwaltung Ihrer Website erleichtert.

Wenn Sie unseren Bluehost-Gutscheincode verwenden, dann können Sie bis zu 61% Rabatt auf Ihren ersten Einkauf erhalten. Klicken Sie einfach auf die Schaltfläche unten, um es zu bekommen:

Bluehost offer for WPBeginner readers

Wie Sie vermeiden, dass Ihr WordPress-Speicher überlastet wird

Nachdem Sie nun den WordPress-Fehler „Speicher erschöpft“ behoben haben, finden Sie hier einige proaktive Schritte, um zu verhindern, dass dieser Fehler erneut auftritt:

Wir hoffen, dass dieser Artikel Ihnen geholfen hat, den WordPress-Fehler mit erschöpftem Speicher zu lösen, indem Sie das PHP-Speicherlimit erhöht haben. Vielleicht interessieren Sie sich auch für unsere Schritt-für-Schritt-Anleitung für Anfänger zur Fehlerbehebung bei WordPress und unsere Expertenauswahl der besten WordPress-Plugins zur Erweiterung Ihrer Website.

Wenn Ihnen dieser Artikel gefallen hat, dann abonnieren Sie bitte unseren YouTube-Kanal für WordPress-Videotutorials. Sie können uns auch auf Twitter und Facebook finden.

Offenlegung: Unsere Inhalte werden von unseren Lesern unterstützt. Das bedeutet, dass wir möglicherweise eine Provision verdienen, wenn Sie auf einige unserer Links klicken. Mehr dazu erfahren Sie unter Wie WPBeginner finanziert wird , warum das wichtig ist und wie Sie uns unterstützen können. Hier finden Sie unseren redaktionellen Prozess .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Das ultimative WordPress Toolkit

Erhalte KOSTENLOSEN Zugang zu unserem Toolkit - eine Sammlung von WordPress-bezogenen Produkten und Ressourcen, die jeder Profi haben sollte!

Reader Interactions

464 KommentareEine Antwort hinterlassen

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. mohadese esmaeeli says

    With your permission, I’d like to add a note for users to the article:
    Please note that htaccess is a hidden file. First, check if it exists. In case you couldn’t find the .htaccess file in your hosting, you can create one using text editor programs like Notepad. Simply create a file named htaccess. Alternatively, in the public_html directory, click on „New File“ and create a file with the same name.

  3. mohadese esmaeeli says

    I have encountered this issue multiple times, and it seems to be one of the most common problems in the WordPress domain. Each time, I either contacted the hosting support or edited the htaccess file to resolve the issue. The htaccess file appears to be like a magic solution, and whenever an issue arises, it can be quickly reviewed and fixed.

  4. Mrteesurez says

    I used to encounter some errors like this on my websites but I didn’t know what to do. Something when I tried to solve it, I just uninstall the step and re-install it back and upload the backup.
    I noticed the problems still persist, when I enable wp debug mode, t then see the exact errors and the it’s source.
    I later find this guide and implented it and it works.

    Thanks.

  5. karma tsheten says

    AFter updating my .htaccess it gives me this error:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

  6. Jiří Vaněk says

    Regarding the .htaccess file, be cautious. Many shared web hosting providers may have directives for increasing the memory limit disabled. Such a directive in the .htaccess file can cause a 500 error on the website, requiring its removal or commenting out. Be careful with this. Sometimes, simply increasing the memory limit may not solve the problem but rather delay it, like a painkiller. The pain might subside, but it doesn’t mean the cause has been resolved. Therefore, while increasing the memory limit might seem like a solution, it’s also important to check what is consuming the memory. Sometimes, people increase the memory limit from 512 MB to 1024 MB without considering whether it’s necessary, and whether the memory limit isn’t masking an underlying issue on the website.

    • WPBeginner Support says

      Thank you for sharing your feedback on the htaccess change. Unless the host has very strict rules in place adding to the htaccess shouldn’t cause an error it is more likely to not work and would require you reach out to the host to request an override.

      Admin

  7. Aisha says

    It doesn’t solve my problem still shows an error after placing the code “define( ‘WP_MEMORY_LIMIT’, ‘256M’ );” and I also change the size of Memory_limit of Php.ini file

    • WPBeginner Support says

      As we state in the article, if our code does not work, there is a good chance your hosting provider is overriding the memory limit and you would need to reach out to your host to fix the error.

      Admin

  8. Sohaib Siddiq says

    It doesn’t solve my problem still shows an error after placing the code „define( ‚WP_MEMORY_LIMIT‘, ‚256M‘ );“ & this is my front-end page showing

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 8192 bytes) in /home/X/wp-includes/class-wp-dependencies.php on line 260

    • WPBeginner Support says

      If the code does not work for you, we recommend reaching out to your hosting provider as they may have a limit set on their end that could be the root of the issue.

      Admin

  9. Ifedayo says

    Thank you, this was helpful! All problem has been solved by carefully following this step-by-step instructions. Keep up the good work :)

  10. Doy says

    Hi,

    Thank you for this awesome website. I got this in the error log after adding this code.
    [26-Apr-2022 02:45:31 UTC] PHP Warning: Use of undefined constant ‘WP_MEMORY_LIMIT’ – assumed ‚‘WP_MEMORY_LIMIT’‘ (this will throw an Error in a future version of PHP) in /wp-config.php on line x

    Is this a problem? Should I remove the code?

    • WPBeginner Support says

      That would only be an error for future versions of PHP. This solution should only be a temporary fix and your hosting provider should be able to assist with the root cause of the issue.

      Admin

  11. Alison Taylor says

    Thank you! You folks rock. This solved my problem. WPBeginner is my go-to website for learning new things about WordPress, even though I’m not a beginner.

  12. J h says

    „Once you are done, you need to save your changes and upload your wp-config.php file back to your server.“

    How again do you upload the file back to your server?

    • WPBeginner Support says

      You would need to use FTP or your host’s file manager again and there should be the option to upload and replace the file :)

      Admin

  13. Daniel says

    The changes are not having effects. We are still with 40MB and the site does not accept the changes. What should I do?

    • WPBeginner Support says

      As we state at the end of the article, if our recommendations do not work, please reach out to your hosting provider as they may have set a limit that would override what you as a user can set.

      Admin

  14. Liviu says

    Really worked.

    I had white screen when I wanted to create a new post on PC browser. But worked on my phone.

    Thanks

  15. John Harries says

    Thank you for providing a straight forward solution to an error which occurred when I tried to update the php version from 7.1 to 7.4

  16. Mart says

    Fantastic, thank you soooo much for this, simple straight talk.. excellent.. first problem solved … now got to learn more

    • WPBeginner Support says

      It can mean the site can take longer to notice issues if some arise but shouldn’t cause a major issue in general.

      Admin

  17. Mujahid Siyal says

    I added the code problem is gone but a text „WP_MEMORY_LIMIT“ has appeared in the top corner of logo. So what should I do about that?

    • WPBeginner Support says

      You would want to ensure you added the code snippet correctly as it is likely showing that code thinking it is text.

      Admin

  18. David says

    „First you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.“

    Simple! What does that mean? It is gobbledegook to me.

  19. Katerina says

    I’m new in WordPress and I’m trying to figure out, for a couple of days, why suddenly I get an error 500 and can’t save my edits. This helped solve my problem. Thank you so much!

  20. Arpita Hunka says

    This solution is not working for me, my website is hosted at AWS server and I have all the access, I have tried to set memory_limit in php.ini, wp-config and .htaccess. but still getting issue when accessing backend pages.

    • WPBeginner Support says

      You would want to reach out to the support for your hosting for what other options you have available with AWS

      Admin

    • WPBeginner Support says

      If our recommendations are not working, you would want to reach out to your hosting provider and they should be able to assist

      Admin

  21. Ivan says

    Hi, I had the memory exhausted message and I increased the wp memory limit to 12mb and it worked. Then a few days later I had the same error, so I had to increase the wp memory limit to 256mb and the message kept showing. I am currently on 1024mb, which seems excessive for a small website of 4 pages and a blog post of 15,000 words. Any suggestions how to resolve the issue or what might be causing it?

    • WPBeginner Support says

      You would want to reach out to your hosting provider and they can normally assist in finding the root of the issue for your specific site.

      Admin

Eine Antwort hinterlassen

Danke, dass du einen Kommentar hinterlassen möchtest. Bitte beachte, dass alle Kommentare nach unseren kommentarpolitik moderiert werden und deine E-Mail-Adresse NICHT veröffentlicht wird. Bitte verwende KEINE Schlüsselwörter im Namensfeld. Lass uns ein persönliches und sinnvolles Gespräch führen.