{"id":8078,"date":"2019-11-27T08:26:30","date_gmt":"2019-11-27T08:26:30","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=8078"},"modified":"2024-03-01T22:05:54","modified_gmt":"2024-03-01T22:05:54","slug":"fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","status":"publish","type":"post","link":"\/in\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","title":{"rendered":"upload_max_filesize Error: How to Fix the File Size Limit in WordPress"},"content":{"rendered":"<p>Most hosting providers set limits to the PHP memory designated for running applications and scripts. <strong>The uploaded file exceeds the upload_max_filesize directive in php.ini <\/strong>is an error that occurs on your WordPress site when you upload a file that exceeds the limitations set by your webserver.<\/p><p>As scary as this error may seem, the solutions are pretty straight-forward. In this tutorial, you will learn how to debug this WordPress error by increasing the default limit of <strong>upload_max_filesize <\/strong>through a few methods.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all in one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-fix-the-upload-max-filesize-error\">How to Fix the upload_max_filesize Error<\/h2><p>The solution, as you might have guessed, involves increasing the default limit of <strong>upload_max_filesize<\/strong>. Let&rsquo;s dive into it and see what steps we can take to fix this WordPress error.<\/p><h3 class=\"wp-block-heading\" id=\"h-method-1-editing-the-htaccess-file\">Method 1. Editing the .htaccess File<\/h3><p>The quickest fix for<strong> the uploaded file exceeds the upload_max_filesize directive in php.ini&nbsp;<\/strong>error is increasing your PHP resource limits by tweaking the <strong>.htaccess<\/strong> file. Here&rsquo;s how to do it:<\/p><ol class=\"wp-block-list\">\n<li>Login to hPanel and navigate to <strong>File Manager<\/strong> in the <strong>Dashboard <\/strong>section.<\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-filemanager-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"627\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/04\/hpanel-dashboard-filemanager-highlighted-1024x627.png\" alt=\"hPanel dashboard, File manager highlighted\" class=\"wp-image-83743\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/04\/hpanel-dashboard-filemanager-highlighted.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/04\/hpanel-dashboard-filemanager-highlighted-300x184.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/04\/hpanel-dashboard-filemanager-highlighted-150x92.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/04\/hpanel-dashboard-filemanager-highlighted-768x470.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>2. <span style=\"font-size: revert;color: initial;, sans-serif\">Locate the <\/span><strong style=\"font-size: revert;color: initial;, sans-serif\">.htaccess<\/strong><span style=\"font-size: revert;color: initial;, sans-serif\"> file inside the <strong>public_html<\/strong> directory and right-click to <\/span><strong style=\"font-size: revert;color: initial;, sans-serif\">Edit<\/strong><span style=\"font-size: revert;color: initial;, sans-serif\">.<\/span><\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected.png\"><img decoding=\"async\" width=\"1024\" height=\"414\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected-1024x414.png\" alt='File Manager with the .htaccess file selected via right-click and the \"Edit\" option highlighted.' class=\"wp-image-80782\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected-300x121.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected-150x61.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-filemanager-publichtml-htaccess-editbuttonselected-768x311.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>3. <span style=\"font-size: revert;color: initial;, sans-serif\">Add the following line at the bottom of the file:<\/span><\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php_value upload_max_filesize 256M<\/pre><p>Then <strong>Save<\/strong> the changes. <\/p><p>That&rsquo;s it! Increasing the <strong>upload_max_filesize&nbsp;<\/strong>value should automatically fix the error.<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p> Adjust the PHP limits to any desired values as long as your web hosting providers support it. You can also locate the maximum available limits by checking the <a href=\"\/in\/tutorials\/how-to-create-phpinfo-file\">PHP info<\/a> of your website. <\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-method-2-editing-the-wp-config-php-file\">Method 2. Editing the wp-config.php File<\/h3><p>Another way to get rid of the uploaded file exceeding the <strong>upload_max_filesize directive in php.ini error<\/strong> is by tweaking the <a href=\"\/in\/tutorials\/wp-config-php\"><strong>wp-config.php<\/strong> file<\/a> located in your root directory.<\/p><p>All you need to do is log in to the hPanel and access <strong>public_html <\/strong>to edit the <strong>wp_config.php <\/strong>file. Add the following line before the &ldquo;That&rsquo;s all, stop editing! Happy publishing&rdquo; line:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@ini_set('upload_max_size' , '256M' );<\/pre><p>Now <strong>Save<\/strong> the file, refresh your web browser, and try uploading again!<\/p><h3 class=\"wp-block-heading\" id=\"h-method-3-updating-php-ini-to-fix-the-upload-max-filesize-error\">Method 3. Updating php.ini to Fix the upload_max_filesize Error<\/h3><p>If you look closer at the <strong>uploaded file exceeds the upload_max_filesize directive in php.ini<\/strong> error message, we can safely assume that it has something to do with <strong>php.ini,<\/strong> a file that holds all of the PHP related variables.<\/p><p>If you&rsquo;re using shared web hosting by Hostinger, including <a href=\"\/in\/wordpress-hosting\">WordPress site hosting<\/a>, all limits are already at the maximum value for user convenience. As a result, it&rsquo;s not possible to alter <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583191-how-can-i-change-the-php-ini-file?utm_content=article_1583191\" target=\"_blank\" rel=\"noopener\">php.ini<\/a>.<\/p><p>However, you can always modify your PHP settings through the <strong>PHP Configuration<\/strong> tool on hPanel if you wish.<\/p><p>If you&rsquo;re using VPS or a different platform, you can try updating<strong> php.ini<\/strong> to fix the error. Here&rsquo;s what you need to do:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to your <strong>php.ini <\/strong>file and edit it. If you can&rsquo;t find it, ask for assistance from your hosting providers.<\/li>\n\n\n\n<li>Locate the upload_max_filesize and increase it by changing its number. You can also boost a few other limitations, as shown below: <br><code>upload_max_filesize = 256M <br>post_max_size = 256M <br>memory_limit = 512M <br>max_execution_time = 180 <\/code><\/li>\n\n\n\n<li>Save the file, and that&rsquo;s it. The error should no longer occur.<\/li>\n<\/ol><h3 class=\"wp-block-heading\" id=\"h-method-4-making-changes-to-php-configurations-on-hpanel\">Method 4. Making Changes to PHP Configurations on hPanel<\/h3><p>For Hostinger clients, modifying PHP configurations can&rsquo;t get any easier. Hostinger offers a custom-built tool to edit and adjust the PHP settings of your hosting account.<\/p><p>Log in to hPanel and head to <strong>PHP Configuration<\/strong> under <strong>Advanced<\/strong>.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-1.png\"><img decoding=\"async\" width=\"398\" height=\"316\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-1.png\" alt=\"hPanel's Advanced menu with PHP Configuration being highlighted. \" class=\"wp-image-80722\" style=\"width:398px;height:316px\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-1.png 398w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-1-300x238.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-1-150x119.png 150w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/a><\/figure><\/div><p>Then, switch to the <strong>PHP Options<\/strong> menu and scroll down to find<strong> uploadMaxFilesize<\/strong> row and make changes as needed.<\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize.png\"><img decoding=\"async\" width=\"1024\" height=\"220\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize-1024x220.png\" alt=\"uploadMaxFilesize option from the PHP Option settings on hPanel.\" class=\"wp-image-80798\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize-1024x220.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize-300x65.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize-150x32.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize-768x165.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/03\/hpanel-advanced-phpconfiguration-phpoption-uploadmaxfilesize.png 1334w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-method-5-contacting-customer-support-to-fix-the-upload-max-filesize-error\">Method 5. Contacting Customer Support to Fix the upload_max_filesize Error<\/h3><p>If none of the options above fixed the error, try contacting your web hosting support team.<\/p><p>Explain the situation and let them know what steps you took to fix the WordPress error, and hopefully, they&rsquo;ll resolve the problem for you.<\/p><p>If you&rsquo;re a Hostinger client, our customer success agents are ready to help you out <strong>24\/7<\/strong> through our live chat feature. Log in to the hPanel and access the chat feature at the bottom right of your dashboard.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner-1024x300.png\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner-1024x300.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner-768x225.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner-1536x450.png 1536w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2024\/06\/New-WP_in-text-banner.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>In this tutorial, you have learned five different ways to fix the<strong> uploaded file exceeds the upload_max_filesize directive in php.ini<\/strong> error in WordPress. Here&rsquo;s a quick recap:<\/p><ul class=\"wp-block-list\">\n<li>Increasing upload_max_filesize and other PHP values through the <strong>.htaccess<\/strong> file<\/li>\n\n\n\n<li>Setting higher upload_max_filesize through the <strong>wp-config.php<\/strong> file<\/li>\n\n\n\n<li>Editing<strong> php.ini<\/strong> file to increase upload_max_filesize<\/li>\n\n\n\n<li>Editing and adjusting PHP configurations through the <strong>PHP Configuration<\/strong> feature on hPanel<\/li>\n\n\n\n<li>Contacting your hosting providers for assistance<\/li>\n<\/ul><p>Easy, right? If you have any questions or suggestions, don&rsquo;t hesitate to comment down below!<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Learn How to Solve Other WordPress Errors<\/h4>\n                    <p> <a href=\"\/in\/tutorials\/fix-wordpress-briefly-unavailable-for-scheduled-maintenance\">How to Fix \"Briefly Unavailable for Scheduled Maintenance\" Error<\/a><br>\n<a href=\"\/in\/tutorials\/how-to-fix-wordpress-missed-schedule\">How to Fix Missed Schedule Error in WordPress<\/a><br>\n<a href=\"\/in\/tutorials\/fix-mixed-content-wordpress\/\">How to Fix Mixed Content on WordPress<\/a><br>\n<a href=\"\/in\/tutorials\/find-fix-broken-links-wordpress\">How to Fix Broken Links on WordPress<\/a><br>\n<a href=\"\/in\/tutorials\/how-to-fix-error-404\">How to Solve 404 WordPress Error<\/a><br>\n<a href=\"\/in\/tutorials\/wordpress-not-sending-email\">How to Solve WordPress Not Sending Emails<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most hosting providers set limits to the PHP memory designated for running applications and scripts. The uploaded file exceeds the upload_max_filesize directive in php.ini is an error that occurs on your WordPress site when you upload a file that exceeds the limitations set by your webserver. As scary as this error may seem, the solutions [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"","rank_math_description":"","rank_math_focus_keyword":"","footnotes":""},"categories":[22636,22633],"tags":[],"class_list":["post-8078","post","type-post","status-publish","format-standard","hentry","category-security-and-maintenance","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/corrigir-erro-o-arquivo-ultrapassa-o-limite-definido-em-upload-max-filesize-no-phpini","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/solucionar-el-error-el-archivo-subido-excede-la-directiva-upload-max-filesize-en-php-ini-wordpress","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-mengatasi-upload_max_filesize","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/solucionar-el-error-el-archivo-subido-excede-la-directiva-upload-max-filesize-en-php-ini-wordpress","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/solucionar-el-error-el-archivo-subido-excede-la-directiva-upload-max-filesize-en-php-ini-wordpress","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-solucionar-el-error-upload_max_filesize-en-wordpress","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/corrigir-erro-o-arquivo-ultrapassa-o-limite-definido-em-upload-max-filesize-no-phpini","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/8078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=8078"}],"version-history":[{"count":60,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/8078\/revisions"}],"predecessor-version":[{"id":105087,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/8078\/revisions\/105087"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=8078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=8078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=8078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}