{"id":3422,"date":"2022-07-25T23:49:29","date_gmt":"2022-07-25T21:49:29","guid":{"rendered":"https:\/\/vielhuber.de\/?p=3422"},"modified":"2023-08-24T16:05:17","modified_gmt":"2023-08-24T14:05:17","slug":"memory-limit-in-wordpress","status":"publish","type":"post","link":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/","title":{"rendered":"Memory Limit in WordPress"},"content":{"rendered":"\n<p>tl;dr: Manuell gesetzte Wert oder die Default-Werte von <code>WP_MEMORY_LIMIT<\/code>\/<code>WP_MAX_MEMORY_LIMIT<\/code> haben keinen Effekt, wenn <code>WP_MEMORY_LIMIT<\/code>\/<code>WP_MAX_MEMORY_LIMIT<\/code> kleiner oder gleich als das Memory Limit von PHP (im Weiteren <code>memory_limit<\/code> genannt) ist. Sie dienen dazu, zu niedrige Werte von <code>memory_limit<\/code> dynamisch auf ein empfohlenes Minimum anzuheben.<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul class=\"wp-block-list\">\n<li>Die Konstante <code>WP_MEMORY_LIMIT<\/code> kann optional in <code>wp-config.php<\/code>&nbsp;mit <code>define('WP_MEMORY_LIMIT', 'XXXM');<\/code> gesetzt werden.<\/li>\n\n\n\n<li>Die Konstante <code>WP_MAX_MEMORY_LIMIT<\/code> kann optional in <code>wp-config.php<\/code>&nbsp;mit <code>define('WP_MAX_MEMORY_LIMIT', 'XXXM');<\/code> gesetzt werden.<\/li>\n\n\n\n<li>Ist <code>WP_MEMORY_LIMIT<\/code> nicht gesetzt, gilt f\u00fcr dessen Default-Wert:\n<ul class=\"wp-block-list\">\n<li><code>memory_limit<\/code>, sofern der Wert von <code>memory_limit<\/code> nicht dynamisch \u00e4nderbar ist,<\/li>\n\n\n\n<li>64 MB sofern es eine Multisite ist,<\/li>\n\n\n\n<li>40 MB ansonsten.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Ist <code>WP_MAX_MEMORY_LIMIT<\/code> nicht gesetzt, gilt f\u00fcr dessen Default-Wert:\n<ul class=\"wp-block-list\">\n<li><code>memory_limit<\/code>, sofern der Wert des <code>memory_limit<\/code> nicht dynamisch \u00e4nderbar ist oder wenn er unbegrenzt (-1) oder gr\u00f6\u00dfer gleich 256 MB ist,<\/li>\n\n\n\n<li>256 MB ansonsten.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Die Default-Werte wurden in der Vergangenheit immer <a href=\"https:\/\/core.trac.wordpress.org\/changeset\/21809\" target=\"_blank\" rel=\"noreferrer noopener\">wieder<\/a> <a href=\"https:\/\/core.trac.wordpress.org\/attachment\/ticket\/29341\/29341.diff\" target=\"_blank\" rel=\"noreferrer noopener\">angehoben<\/a>.<\/li>\n\n\n\n<li><code>WP_MEMORY_LIMIT<\/code> ver\u00e4ndert \u00fcberall mit Hilfe der Funktion <a href=\"https:\/\/www.php.net\/manual\/de\/function.ini-set.php\" target=\"_blank\" rel=\"noreferrer noopener\">ini_set()<\/a> dynamisch <code>memory_limit<\/code>, wenn <code>WP_MEMORY_LIMIT<\/code> gr\u00f6\u00dfer als das aktuelle <code>memory_limit<\/code> oder wenn <code>WP_MEMORY_LIMIT<\/code> unbegrenzt (-1) ist.<\/li>\n\n\n\n<li><code>WP_MAX_MEMORY_LIMIT<\/code> ver\u00e4ndert im Backend (genauer: immer dann, wenn die Funktion <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_raise_memory_limit\/\" target=\"_blank\" rel=\"noreferrer noopener\">wp_raise_memory_limit()<\/a> in unterschiedlichen Kontexten [admin, image] aufgerufen wird) mit Hilfe der Funktion <a href=\"https:\/\/www.php.net\/manual\/de\/function.ini-set.php\" target=\"_blank\" rel=\"noreferrer noopener\">ini_set()<\/a> dynamisch <code>memory_limit<\/code>, wenn <code>WP_MAX_MEMORY_LIMIT<\/code> gr\u00f6\u00dfer als das aktuelle <code>memory_limit<\/code> oder wenn <code>WP_MAX_MEMORY_LIMIT<\/code> unbegrenzt (-1) ist.<\/li>\n\n\n\n<li>Die Logik von <code>WP_MAX_MEMORY_LIMIT<\/code> l\u00e4uft <em>nach<\/em> der Logik von <code>WP_MEMORY_LIMIT<\/code>, sodass <code>WP_MEMORY_LIMIT<\/code> im Frontend und <code>WP_MAX_MEMORY_LIMIT<\/code> im Backend greift.<\/li>\n\n\n\n<li>Die oben beschriebene Logik findet zum Gro\u00dfteil in der Funktion <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_initial_constants\/#source\" target=\"_blank\" rel=\"noreferrer noopener\">wp_initial_constants()<\/a> (<code>\/wp-includes\/default-constants.php<\/code>) sowie in <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_raise_memory_limit\/\" target=\"_blank\" rel=\"noreferrer noopener\">wp_raise_memory_limit()<\/a> (<code>\/wp-includes\/functions.php<\/code>) statt.<\/li>\n\n\n\n<li>Der Wert <code>memory_limit = XXXM<\/code> in <code>php.ini<\/code> definiert <code>memory_limit<\/code> (nach Neustart des Webdienstes).<\/li>\n\n\n\n<li>Der Wert <code>php_value memory_limit XXXM<\/code> in <code>.htaccess<\/code> definiert <code>memory_limit<\/code> f\u00fcr alle PHP-Dateien im Ordner oder dessen Unterordner, in dem sich die <code>.htaccess<\/code> befindet.<\/li>\n\n\n\n<li>Der Webserver kann verhindern, dass der Wert des Memory Limits mit <a href=\"https:\/\/www.php.net\/manual\/de\/function.ini-set.php\" target=\"_blank\" rel=\"noreferrer noopener\">ini_set()<\/a> ver\u00e4ndert wird oder einen vorgegebenen Wert \u00fcberschreitet (siehe <a href=\"https:\/\/www.php.net\/manual\/en\/configuration.changes.php\" target=\"_blank\" rel=\"noreferrer noopener\">php_admin_value<\/a>).<\/li>\n\n\n\n<li><code>memory_limit<\/code> gilt pro Prozess: Eine Erh\u00f6hung von <code>memory_limit<\/code> <em>kann<\/em> dazu f\u00fchren, dass die Anzahl der parallelen PHP-Requests abnimmt. Der Wert sollte daher mit bedacht gew\u00e4hlt sein (256 MB, in Ausnahmef\u00e4llen 512 MB).<\/li>\n\n\n\n<li>Im WordPress-Backend unter Werkzeuge &gt; Website-Zustand k\u00f6nnen die Werte von <code>memory_limit<\/code> (Abschnitt: Server), sowie von <code>WP_MEMORY_LIMIT<\/code> und <code>WP_MAX_MEMORY_LIMIT<\/code> (Abschnitt WordPress-Konstanten) ausgelesen werden.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT kleiner oder gleich als das Memory Limit von PHP (im Weiteren memory_limit genannt) ist. Sie dienen dazu, zu niedrige Werte von memory_limit dynamisch auf ein empfohlenes Minimum anzuheben.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"gtbabel_prevent_lngs":"","gtbabel_alt_lng":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-3422","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-blog"},"acf":[],"yoast_head":"<title>Memory Limit in WordPress &#060; Vielhuber David<\/title>\n<meta name=\"description\" content=\"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LI...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Memory Limit in WordPress &#060; Vielhuber David\" \/>\n<meta property=\"og:description\" content=\"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Vielhuber David\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-25T21:49:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-24T14:05:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"552\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:site\" content=\"@vielhuber\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"David\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/\"},\"author\":{\"name\":\"David\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"headline\":\"Memory Limit in WordPress\",\"datePublished\":\"2022-07-25T21:49:29+00:00\",\"dateModified\":\"2023-08-24T14:05:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/\"},\"wordCount\":323,\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"articleSection\":[\"Blog\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/\",\"name\":\"Memory Limit in WordPress &#060; Vielhuber David\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\"},\"datePublished\":\"2022-07-25T21:49:29+00:00\",\"dateModified\":\"2023-08-24T14:05:17+00:00\",\"description\":\"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\\\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\\\/WP_MAX_MEMORY_LIMIT\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/blog\\\/memory-limit-in-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vielhuber.de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Memory Limit in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#website\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/\",\"name\":\"Vielhuber David\",\"description\":\"Full-Stack Developer\",\"publisher\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vielhuber.de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/vielhuber.de\\\/#\\\/schema\\\/person\\\/64d4ff14713d413ea4d9b210d0c2c6ef\",\"name\":\"David\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"url\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"contentUrl\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\",\"width\":700,\"height\":552,\"caption\":\"David\"},\"logo\":{\"@id\":\"https:\\\/\\\/vielhuber.de\\\/wp-content\\\/uploads\\\/about.jpg\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/vielhuber\"]}]}<\/script>","yoast_head_json":{"title":"Memory Limit in WordPress &#060; Vielhuber David","description":"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LI...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/","og_locale":"de_DE","og_type":"article","og_title":"Memory Limit in WordPress &#060; Vielhuber David","og_description":"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT","og_url":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/","og_site_name":"Vielhuber David","article_published_time":"2022-07-25T21:49:29+00:00","article_modified_time":"2023-08-24T14:05:17+00:00","og_image":[{"width":700,"height":552,"url":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","type":"image\/jpeg"}],"author":"David","twitter_card":"summary_large_image","twitter_creator":"@vielhuber","twitter_site":"@vielhuber","twitter_misc":{"Verfasst von":"David","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/"},"author":{"name":"David","@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"headline":"Memory Limit in WordPress","datePublished":"2022-07-25T21:49:29+00:00","dateModified":"2023-08-24T14:05:17+00:00","mainEntityOfPage":{"@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/"},"wordCount":323,"publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"articleSection":["Blog"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/","url":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/","name":"Memory Limit in WordPress &#060; Vielhuber David","isPartOf":{"@id":"https:\/\/vielhuber.de\/#website"},"datePublished":"2022-07-25T21:49:29+00:00","dateModified":"2023-08-24T14:05:17+00:00","description":"tl;dr: Manuell gesetzte Wert oder die Default-Werte von WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT haben keinen Effekt, wenn WP_MEMORY_LIMIT\/WP_MAX_MEMORY_LIMIT","breadcrumb":{"@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vielhuber.de\/blog\/memory-limit-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vielhuber.de\/"},{"@type":"ListItem","position":2,"name":"Memory Limit in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/vielhuber.de\/#website","url":"https:\/\/vielhuber.de\/","name":"Vielhuber David","description":"Full-Stack Developer","publisher":{"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vielhuber.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/vielhuber.de\/#\/schema\/person\/64d4ff14713d413ea4d9b210d0c2c6ef","name":"David","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","url":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","contentUrl":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg","width":700,"height":552,"caption":"David"},"logo":{"@id":"https:\/\/vielhuber.de\/wp-content\/uploads\/about.jpg"},"sameAs":["https:\/\/x.com\/vielhuber"]}]}},"_links":{"self":[{"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/posts\/3422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/comments?post=3422"}],"version-history":[{"count":16,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/posts\/3422\/revisions"}],"predecessor-version":[{"id":3791,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/posts\/3422\/revisions\/3791"}],"wp:attachment":[{"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/media?parent=3422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/categories?post=3422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vielhuber.de\/zu\/wp-json\/wp\/v2\/tags?post=3422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}