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

Die Fehlermeldung “Erlaubte Speichergröße erschöpft” in WordPress kann frustrierend sein. Es ist ein häufiges Problem, das auftritt, wenn Ihre Website mehr PHP-Speicher benötigt, als erlaubt ist.

Dieser Fehler kann Ihre Website verlangsamen oder sie sogar vorübergehend zum Absturz bringen. Deshalb ist es wichtig, ihn schnell zu beheben, damit Ihre Website für die Besucher reibungslos funktioniert.

Glücklicherweise gibt es eine einfache Lösung für dieses Problem. Indem Sie das PHP-Speicherlimit erhöhen, können Sie diesen Fehler beheben und die Leistung Ihrer Website verbessern.

In dieser Anleitung führen wir Sie durch die einfachen Schritte, um das PHP-Speicherlimit zu erhöhen und Ihre Website wieder zum Laufen zu bringen.

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 Speicher, 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 Serverspeicher 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.

Im nächsten Abschnitt zeigen wir Ihnen, wie Sie das PHP-Speicherlimit in WordPress einfach erhöhen können, um den Fehler “Speicher erschöpft” zu vermeiden. Sie können die unten stehenden Links verwenden, um durch das Tutorial 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.

Sind Sie bereit? Lasst uns gleich loslegen!

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 bei dem vorherigen Code wird WordPress angewiesen, das PHP-Speicherlimit auf 256 MB zu erhöhen.

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, können Sie in unserem Leitfaden nachlesen, warum die .htaccess-Datei fehlen kann und wie man sie findet.

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.

Sind Sie es leid, sich mit WordPress-Fehlern herumzuschlagen? Dann lassen Sie den Stress hinter sich und lassen Sie unser Expertenteam schnellen und zuverlässigen Notfall-Support leisten. Mit unserem On-Demand-Service erhalten Sie schnelle Lösungen, ohne dass Sie sich mit laufenden Verträgen herumschlagen müssen. Rufen Sie unser WordPress-Notfall-Support-Team jetzt an!

Option 4: Upgrade Ihres WordPress-Hostings

Wenn die Fehlermeldung “Speicher erschöpft” ständig auftritt, 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, aber 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

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 “Speicher erschöpft” zu lösen, indem Sie das PHP-Speicherlimit erhöhen. Vielleicht interessieren Sie sich auch für unsere Schritt-für-Schritt-Anleitung für Anfänger zur Fehlerbehebung bei WordPress und unsere Expertenliste der häufigsten WordPress-Fehler.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

463 KommentareLeave a Reply

  1. Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262198 bytes) in /home/content/p3pnexwpnas04_data01/91/3161991/html/wp-content/object-cache.php on line 574

  2. Thanks! Worked like a charm! I tried 64M and did not worked, then I tried 512M and worked. Note: I always makes notes on my files for future reference, so I noticed that for some weird reason, when I wrote a note it did not worked, I removed the note and worked … I know! it is weird, but I am just sharing my weird experience in case this happens to someone else.

  3. It really worked like a charm on my site One thing i am beginning to learning about wordpress. Have you FTP app open and ready when handling any upgrades or plugins installs

  4. Sometimes 64M also doesn’t work try to change it to 128M, then it will work fine.
    Thanks for sharing this awesome info :)

  5. I’ve been getting this error for a couple of weeks now and my host continually increases the memory but it still occurs when I’m doing updates and going in and out of my WP dashboard.

    Error below:

    Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 96 bytes) in /home/vwa9843/public_html/example.com/wp-includes/wp-db.php on line 1833

    I’ve checked the plugins and they are all low of memory they take up.

    Is there any other solution I could try?

    Thanks

  6. I’m getting this problem..please help me wp beginner..

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 786432 bytes) in /home/mom14isgod/public_html/wp-includes/SimplePie/Item.php on line 2736

  7. Howdy,

    Where exactly should I place this in the wp-config.php file? Under what? Before what?

    Please help – I think this issue has made me a bit more insane!

    Ta
    JK

  8. sir i am trying to upload images in wordpress directory but after add images in wordpress page its not showing and also showing 404 error can you tell me the reason ?

  9. Problem: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) ..

    Solve: I sovle It

    step 1. Login Cpanel

    step 2. Go to Web root (public_html/www) click GO

    step 3 find php.ini OR .htaccess file

    edit php.ini OR .htaccess file

    max_execution_time = 30
    max_input_time = 60
    memory_limit = 128M

    TO

    max_execution_time = 30
    max_input_time = 60

    memory_limit = 512M

    Then solve my error.

    If any body face problem please contact me at

    • Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 18 bytes) in /home/unlockingportal/public_html/wp-content/plugins/Ultimate_VC_Addons/modules/Ultimate_List_Icon.php on line 147
      plz fix this i tried so many times with ur instructions but still i face same problem

    • hi. i have facing some issue with word press online. i worked locally on my machine then upload online, everything working fine, but my theme not editable online.

      HTTP ERROR 500

    • i had put up in the wpconfig.php
      define(‘WP_MEMORY_LIMIT’, ‘512M’); still i am facing the problem
      please help me out

  10. i am getting this eror when i publishig new post
    ”Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes) in /home/veri85fa/public_html/wp-content/plugins/wordpress-23-related-posts-plugin/recommendations.php on line 57
    plz give sloution to fix this

  11. i don’t know how to thank you, i spent the whole day tryig to figure out what’s the problem with my site until i found this simple “memory increase” solution.

    THANK YOU

  12. Thanks WP Beginner!

    It worked great with my website.

    As a suggestion: This happens due to the over usage of memory.

    In my case I had too many Plugins installed in my website.

    I deleted the unused plugins as well and the memory problem was solved easily.

    If you are planing for a robust website it is better to extend the memory on the config.php as you start to build the website.

    Thanks

    Erick

  13. front-end is working fine but when open the back-end i tried to access the menu section under appearance but when i clicked on it, it shows the Fatal Error of Memory exhausted.
    The error is

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in /home/yyyyyy/public_html/yyyyyy.com/wp-includes/meta.php on line 838

    Please help me in this regard.

  14. I got this error when trying to install wordpress does anybody got in solution.

    Fatal error: Maximum execution time of 30 seconds exceeded in F:\xampp\htdocs\site1\wordpress\wp-admin\includes\misc.php on line 105

    thank you
    sandy

  15. New to word press how can I fix the following, any help is much appreciated.

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 6785803 bytes) in /home/content/p3pnexwpnas10_data01/69/2702869/html/wp-content/object-cache.php on line 574

  16. Also had the memory limit problem on edit.php for a custom post type. Found out that if the CPT is hierarchical wp loads all posts so if you dont need it to be hierarchical set it to false in the declaration.

    greets gerhard

  17. Thanks Sabi Hussain, it just fixed my problem. I saw every forum all adressing the same problem, I have 512M allowed with my server, and define in config.php for 128M but it wasn’t working till I saw your comment, best tip ever. It was overwriting what I define in config.php. Thanks a lot!

  18. Hi;
    Supposed to be updating today and got the white screen of death. Went into wp-config.php and changed debug status to true which then popped up with this message. I’ve added the suggested code of both 64 and then 128. This is not working and my host says there is nothing they can do? They keep saying that i’m well below my capacity on my hosting account. I’m not sure they completely understand the issue? Is it something in regards to WordPress that they have to change or does it have to do with my memory space on their server.
    I hope this article isn’t too old and you can response quickly.
    – Ashlee

    • Hi Ashlee,

      If you have already changed your wp-includes/default-constants.php file, it could be the server. If you have access to WHM or a developer does who can change settings like max file size for upload.
      For example, if you are having issues with uploading files to WordPress because of their size this can be changed in WHM under Service Configuration > PHP Configuration Editor. You would want to change the upload_max_filesize field from 2M (default) to whatever file size you need.

  19. Fatal error: Cannot redeclare win_is_writable() (previously declared in /home/u805727311/public_html/wp-includes/functions.php:1684) in /home/u805727311/public_html/wp-admin/includes/misc.php on line 557

    Please solutions

  20. sorry but the suggested solution is not a fix for me.

    I am using a w3 cache plugin but it was not the culprit.
    I’ve increased memory in php.ini and wp-config.php to 512MB and I still get the Fatal error.

    the workaround was to stop non-important plugin and so far the site is OK (temporarily)

  21. Thanks SO much!

    I had created a child theme (my first) and couldn’t understand why just trying to Customize the Appearance in dashboard would cause a Server error. This fix define(‘WP_MEMORY_LIMIT’, ‘128M’); did the trick!!!!

  22. Hey it worked awesome for me…… and thanks to that person who added 128m in comment… i used that tag and it worked =D thanks

  23. Hi Everyone – Is there a fix for this exact same problem, except instead of “/wp-includes/plugin.php” at the end of the error it’s ” /file.php” ?
    I’m still getting the error and I”m unable to update anything on my site. Thanks so much!

  24. I have a white screen and cannot open the items in the wordpress directory (only SEO and guestbook). How to increase the memory?

  25. Thanks for the great tip – worked a treat.
    Unfortunately all we got after an initial upgrade to WordPress was the WSOD when attempting to login and edit our website.
    Your steps were clear and solved our issue – now able to access via admin login again.

  26. I installed a wordpress template and then demo content. After that i tried to access the menu section under appearance but when i clicked on it, it shows the Fatal Error of Memory exhausted.
    The error is

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 28593220 bytes) in /home/xxxx/public_html/xxxxxx.com/wp-admin/includes/nav-menu.php on line 1198

    Please help me in this regard.

  27. Perfect

    added
    128mb to remove error as short term solution
    contacted hosting to see if there needs to be a longer term answer also getting php versions updated as well

    added on top line after php tag
    /** Memory Limit */
    define(‘WP_MEMORY_LIMIT’, ‘128M’);

  28. Thanks for the great article. I encountered this problem and I used a setting in “All in One SEO Pack” to increase the memory limit.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.