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

Poprawka: Błąd wyczerpania pamięci WordPress – Zwiększ pamięć PHP

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Czy widzisz komunikat o błędzie wyczerpania dozwolonego rozmiaru pamięci w WordPress?

Jest to jeden z najczęstszych błędów WordPress i można go łatwo poprawić, zwiększając limit pamięci PHP w WordPress.

W tym artykule pokażemy, jak poprawić błąd wyczerpania pamięci WordPress poprzez zwiększenie limitu pamięci PHP.

Fix: WordPress Memory Exhausted Error – Increase PHP Memory

Czym jest błąd wyczerpania pamięci WordPress?

Błąd wyczerpania pamięci WordPress to komunikat, który możesz zobaczyć, jeśli twoja witryna internetowa ma trudności z wykonywaniem zadań.

WordPress jest zbudowany przy użyciu PHP, języka programowania po stronie serwera, który wymaga pamięci do działania.

Podobnie jak każdy inny komputer, serwery WWW mają ograniczoną ilość pamięci do uruchamiania wielu aplikacji jednocześnie. Dostawcy hostingu WordPress przydzielają określone rozmiary pamięci dla różnych aplikacji, w tym PHP.

Kiedy twój kod WordPress wymaga więcej pamięci niż domyślnie przydzielona, zobaczysz ten komunikat o błędzie:

Błąd krytyczny: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx

Memory exhausted error displayed on a WordPress site

Twoja witryna WordPress może wyczerpywać pamięć serwera, jeśli tak się dzieje:

  • Dużo obrazków, filmów i innego rodzaju multimediów
  • Mnóstwo nieużywanych wtyczek WordPress
  • Przekroczenie zasobów planu hostingowego

Domyślnie WordPress automatycznie próbuje zwiększyć limit pamięci PHP, jeśli jest on mniejszy niż 64 MB. Jednak 64 MB to często za mało.

Powiedziawszy to, zobaczmy, jak łatwo zwiększyć limit pamięci PHP w WordPress, aby uniknąć błędu wyczerpania pamięci.

Możesz skorzystać z poniższych odnośników, aby poruszać się po poradniku:

Uwaga: Niektóre z tych metod wymagają bezpośredniej edycji twoich plików WordPress. Sugerujemy najpierw utworzenie kopii zapasowej twojej witryny internetowej, aby uniknąć dalszych błędów.

Opcja 1: Edycja pliku wp-config.php

Po pierwsze, musisz edytować plik wp-config.php na twojej witrynie WordPress. Jest to jeden z rdzennych plików WordPressa znajdujący się w katalogu głównym, zwykle o nazwie public_html.

Będziesz musiał użyć klienta FTP, takiego jak FileZilla lub menedżera plików w twoim panelu kontrolnym hostingu.

Następnie musisz wkleić następującą linię w pliku wp-config.php tuż przed tą, która mówi: To wszystko, przestań edytować! Szczęśliwego blogowania.

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

Ten kod nakazuje WordPressowi zwiększenie limitu pamięci PHP do 256 MB.

Aby uzyskać więcej informacji, zobacz nasz przewodnik krok po kroku, jak znaleźć i edytować plik wp-config.php.

Gdy skończysz, musisz zapisać zmiany i przesłać plik wp-config.php z powrotem na twój serwer.

Możesz teraz przejść na twoją witrynę WordPress, a błąd wyczerpanej pamięci powinien zniknąć.

Opcja 2: Edycja pliku .htaccess

Kolejną metodą jest edycja pliku .htaccess. Plik ten również znajduje się w katalogu głównym witryny internetowej WordPress.

W tym miejscu należy wkleić następujący kod przed linią z napisem #END WORDPRESS.

php_value memory_limit 256M

Podobnie jak w poprzednim kodzie, powie on WordPressowi, aby zwiększył limit pamięci PHP do 256 MB.p

Następnie zapisz wprowadzone zmiany i prześlij plik z powrotem na serwer WWW. Możesz teraz ponownie otworzyć twoją witrynę internetową WordPress, aby sprawdzić, czy błąd limitu pamięci zniknął.

Jeśli nie możesz znaleźć pliku .htaccess, zapoznaj się z naszym przewodnikiem na temat tego, dlaczego może go bra kować i jak go znaleźć.

Opcja 3: Sprawdzenie twojego pliku php.ini

Jeśli powyższe metody nie działają, możesz zajrzeć do twojego pliku php.ini.

php.ini to plik, który kontroluje twoje ustawienia PHP, w tym wersję PHP i skrypty PHP. Nie jest to plik rdzenia WordPressa, ponieważ zazwyczaj zarządza nim twój dostawca hostingu.

Możesz sprawdzić jego kod, aby zobaczyć twój limit wykorzystania pamięci PHP. Więcej szczegółów można znaleźć w naszym przewodniku na temat znajdowania i edytowania pliku php.ini.

Ponieważ jednak jest to zaawansowana metoda, zalecamy skontaktowanie się z zespołem pomocy technicznej dostawcy hostingu, aby sprawdzić, czy może on ręcznie zwiększyć limit pamięci WordPress. W przeciwnym razie może to spowodować dalsze błędy.

Możesz przeczytać nasz przewodnik na temat tego, jak prawidłowo poprosić o pomoc techniczną WordPress, aby uzyskać więcej informacji.

Opcja 4: Aktualizacja twojego hostingu WordPress

Jeśli ciągle napotykasz błąd wyczerpanej pamięci, może to oznaczać, że twoja witryna internetowa przerosła obecny, aktualny plan hostingowy.

Gdy twoja witryna internetowa przyciąga więcej odwiedzających i dodaje więcej treści, wymaga więcej zasób do sprawnego funkcjonowania. Uaktualnienie do planu z wyższym przydziałem pamięci może być trwałym rozwiązaniem.

Rozważ aktualizację twojego hostingu WordPress, jeśli:

  • Wypróbowałeś poprzednie rozwiązania, ale błąd nadal występuje.
  • Twoja witryna internetowa znacznie zwiększyła ruch lub treść.
  • Planujesz dodanie funkcji lub funkcjonalności, które wymagają większej ilości zasobów.

Bluehost oferuje niedrogie i niezawodne plany hostingowe WordPress, które można skalować wraz z potrzebami twojej witryny internetowej. Zapewniają przyjazną dla użytkownika platformę specjalnie zoptymalizowaną pod kątem WordPress, ułatwiając zarządzanie twoją witryną internetową.

Jeśli skorzystasz z naszego kodu kuponu Bluehost, możesz uzyskać do 61% zniżki na twój pierwszy zakup. Wystarczy kliknąć przycisk poniżej, aby go otrzymać:

Bluehost offer for WPBeginner readers

Jak uniknąć wyczerpania pamięci twojego WordPressa?

Teraz, gdy naprawiono błąd wyczerpania pamięci WordPress, oto kilka proaktywnych kroków, aby zapobiec jego ponownemu wystąpieniu:

Mamy nadzieję, że ten artykuł pomógł ci rozwiązać błąd wyczerpania pamięci WordPress poprzez zwiększenie limitu pamięci PHP. Zachęcamy również do zapoznania się z naszym przewodnikiem dla początkujących krok po kroku dotyczącym rozwiązywania problemów z błędami WordPress a oraz naszymi eksperckimi propozycjami najlepszych wtyczek do WordPressa, które pomogą rozwinąć twoją witrynę.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

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.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

464 komentarzeZostaw odpowiedź

  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. rahul says

    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

  3. Gus says

    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.

  4. Brian says

    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

  5. Muhammad Farooq says

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

  6. Troy Vayanos says

    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

  7. Shubham Singh says

    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

  8. JK says

    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

  9. sajid says

    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 ?

  10. Sarah says

    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

    • Shah Nasir says

      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

    • faisal says

      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

    • john says

      hello mate im having this problem with my wordpress can you help i already tried that what you post. best regards

    • saad says

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

  11. aqib says

    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

  12. Ahmed says

    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

  13. Erick Ferrari says

    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

  14. gopi says

    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.

  15. sandy says

    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

  16. Aldaz says

    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

  17. Gerhard says

    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

  18. Dani says

    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!

  19. David says

    Please how do I locate my Root WordPress Directory. Please explain with images to help me understand better. Thanks

  20. Ashlee says

    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

    • Doug says

      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.

  21. lootoffers says

    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

  22. Dong says

    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)

  23. Victoria Miller says

    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!!!!

  24. mrunmay phanse says

    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

  25. Kim says

    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!

  26. Saskia says

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

  27. Pete Trenery says

    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.

  28. Henry says

    its great thanks , it worked after increase the memory limit up to 128mb

    define(‘WP_MEMORY_LIMIT’, ‘128M’);

  29. Abdul Qayoum says

    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.

  30. Phil says

    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’);

  31. Kasra Khosravi says

    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.

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.