{"id":1355,"date":"2026-06-13T19:26:29","date_gmt":"2026-06-13T19:26:29","guid":{"rendered":"https:\/\/johnnycarlos.com\/?p=1355"},"modified":"2026-06-13T19:33:02","modified_gmt":"2026-06-13T19:33:02","slug":"the-2-mb-upload-limit-that-came-back-from-the-dead-after-an-ubuntu-upgrade","status":"publish","type":"post","link":"https:\/\/johnnycarlos.com\/index.php\/2026\/06\/13\/the-2-mb-upload-limit-that-came-back-from-the-dead-after-an-ubuntu-upgrade\/","title":{"rendered":"The 2 MB Upload Limit that Came Back from the Dead After an Ubuntu Upgrade"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I upgraded my blog server <a href=\"https:\/\/johnnycarlos.com\/index.php\/2026\/06\/12\/upgrading-ubuntu-22-04-to-24-04-while-running-a-live-wordpress-site\/\">from Ubuntu 22.04 to 24.04<\/a> only to realize today that I couldn&#8217;t upload pictures \u2014 that ancient 2 MB default cap had quietly reasserted itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reason it came back: the upgrade installed a fresh PHP 8.3 with a clean <code>php.ini<\/code>, so all my old tuned values were left behind on the previous version&#8217;s config.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I forgot where I put it last time, but here&#8217;s where I fixed it this time around. In <code>\/etc\/php\/8.3\/apache2\/php.ini<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>upload_max_filesize = 256M\npost_max_size = 256M\nmemory_limit = 256M\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>post_max_size<\/code> needs to be at least as high as <code>upload_max_filesize<\/code>, since the upload travels inside the POST body \u2014 set the limit high but leave <code>post_max_size<\/code> low and you&#8217;re silently capped at the lower number. And I bumped <code>memory_limit<\/code> to match, for good measure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart Apache so it picks up the change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart apache2\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I upgraded my blog server from Ubuntu 22.04 to 24.04 only to realize today that I couldn&#8217;t upload pictures \u2014 that ancient 2 MB default cap had quietly reasserted itself. The reason it came back: the upgrade installed a fresh PHP 8.3 with a clean php.ini, so all my old tuned values were left behind [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1355","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/1355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/comments?post=1355"}],"version-history":[{"count":4,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions"}],"predecessor-version":[{"id":1359,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/1355\/revisions\/1359"}],"wp:attachment":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/media?parent=1355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/categories?post=1355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/tags?post=1355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}