If you searched for “increase upload max filesize wordpress”, the fix is usually in PHP rather than in a WordPress setting. Raise upload_max_filesize, set post_max_size a little higher, and then confirm the effective limit in WordPress before trying the upload again.
WordPress uses PHP to process media, theme, plugin and import uploads. When the selected file is larger than PHP’s upload_max_filesize, WordPress can show:
The uploaded file exceeds the upload_max_filesize directive in php.ini.
This is not normally fixed by changing a WordPress media setting. PHP also checks the size of the complete HTTP request through post_max_size. WordPress’s usable limit is effectively the smaller of those two values, so increasing only one may not change what you see in the dashboard.
The three settings to understand are:
| PHP setting | What it controls | Practical example |
|---|---|---|
upload_max_filesize | The largest individual file PHP accepts | 128M |
post_max_size | The largest complete POST request, including the upload and form data | 160M or higher |
max_execution_time | How long a PHP script may run after it starts | 300 seconds |
For a slow upload, max_input_time can matter too because it controls how long PHP may receive input. These values are examples, not a promise that every account can use them. Set a limit that fits the file you actually need to upload and the maximum allowed by your hosting plan.
The WordPress PHP optimisation guide explains the relationship between these limits. PHP’s own documentation also states that post_max_size must be larger than upload_max_filesize for large uploads to work.
Prepare these items before editing a setting:
Do not change the limit simply to a very large number. A 128 MB limit is enough for many theme, plugin and image uploads; a video, backup or migration file may need a different approach. If the file is only slightly over the current limit, a modest increase is easier to verify and maintain.
Why this matters: you need to know which limit is blocking the request and have a value to compare after the change.
The Max effective file size is the most useful value for a normal Media Library upload. If it is lower than the file you selected, continue to the next step. If it is already large enough, the error may come from a multisite quota, a plugin-specific form limit, a timeout or a different upload problem.
Success looks like this: you have written down the current values and know the smallest setting that needs to increase.
Why this matters: the hosting panel is the cleanest place to apply per-domain PHP values when your hosting account exposes them.
upload_max_filesize, post_max_size, max_execution_time and, if available, max_input_time.upload_max_filesize = 128M
post_max_size = 160M
max_execution_time = 300
max_input_time = 300 The DirectAdmin PHP options documentation notes that the available per-domain method depends on the PHP mode. If a setting is missing, disabled or capped at a lower value, use the per-directory method below if your account supports it, or ask your hosting provider to apply the account-level change.
Success looks like this: the values save without an error, and the PHP settings page shows the new values for the correct domain.
Why this matters: a per-directory configuration file can change PHP values for one WordPress installation without changing unrelated websites on the account.
First download a copy of the existing file, if one is present. In DirectAdmin File Manager, open the WordPress document root—the folder containing wp-admin, wp-content and wp-includes—and create or edit the configuration file supported by your PHP mode.
Use php.ini when your hosting setup specifically supports a local php.ini. PHP-FPM setups commonly use .user.ini for user-controlled per-directory values. Do not create both files just to try random combinations; use the method shown by your hosting panel or provider.
Add one setting per line:
upload_max_filesize = 128M
post_max_size = 160M
max_execution_time = 300
max_input_time = 300 Save the file in the site’s document root, then return to WordPress and check Tools > Site Health > Info > Media Handling. Some PHP modes cache per-directory settings, so allow the hosting environment to reload the configuration before deciding that the change did not work.
Do not add define() statements to this file. php.ini and .user.ini use PHP configuration directives, not WordPress constants. Also avoid changing WP_MEMORY_LIMIT for this particular error; memory is a separate issue covered in our guide to increasing the WordPress memory limit.
Success looks like this: Site Health reports the new upload and POST values, and the effective size is above the file you need to upload.
Why this matters: .htaccess can apply PHP values on some Apache configurations, but PHP-FPM does not read php_value directives from .htaccess.
Download a copy of .htaccess before editing it. It is normally in the WordPress document root and may be hidden in File Manager. Add the following lines without removing the existing WordPress rewrite rules:
php_value upload_max_filesize 128M
php_value post_max_size 160M
php_value max_execution_time 300
php_value max_input_time 300 Save the file and check Site Health again. If the setting is unsupported, the site may return a server error because Apache cannot accept php_value in that PHP mode. If that happens, immediately remove the four added lines using File Manager or restore the backup, then use DirectAdmin PHP Settings or .user.ini instead.
Do not put an equals sign after the directive name in this form. The .htaccess syntax is php_value setting value, while the php.ini syntax is setting = value.
Success looks like this: the site remains accessible and Site Health shows the intended values. If the values remain unchanged, remove this method and use the panel or per-directory PHP file.
Why this matters: a saved setting is not enough; WordPress must see the value in the same runtime that processes the upload.
For example, with upload_max_filesize = 128M and post_max_size = 160M, test with a file smaller than 128 MB. Do not use a file that is exactly 128 MB because file-size units and multipart request overhead can make a boundary test fail.
Success looks like this: WordPress accepts the test file, creates its attachment entry, and displays it in the Media Library.
If the reported values did not change, or the new values are high enough but the upload still fails, check the limit that matches the symptom.
| Symptom | What to check |
|---|---|
| The effective size is still low | post_max_size, upload_max_filesize, the correct domain, and the active PHP version |
| A slow upload stops part-way through | max_input_time, max_execution_time, and any web-server timeout |
| Several files fail when uploaded together | max_file_uploads and the combined POST size |
| A multisite upload is rejected | Network Admin’s Max upload file size and the individual site quota |
| The upload finishes but image processing fails | PHP memory_limit, image dimensions, available storage and the file format |
| WordPress shows a generic upload error | The separate HTTP error when uploading images guide |
WordPress’s Site Health screen explains where the maximum post data, upload size and effective file size appear. The PHP core directives reference is useful when a value is ignored or rewritten by the hosting environment.
On shared hosting, some PHP settings are controlled at the server or account level. If DirectAdmin will not save a value, the local file has no effect, or Site Health keeps showing the old value, contact the hosting provider with the exact domain, current values and target values. This is more useful than repeatedly editing wp-config.php or installing a plugin that cannot override the server’s PHP limit.
Increasing the limit is appropriate when WordPress should manage the file in the Media Library. It is not always the best route for a very large backup, video or migration export.
These alternatives do not remove the PHP limit from WordPress. They avoid sending a large file through the particular request that is failing.
There is no single WordPress-wide number. The effective limit is normally the smaller of PHP’s upload_max_filesize and post_max_size, with other server and WordPress rules able to reduce it further. Check Tools > Site Health > Info > Media Handling for the value your site currently uses.
upload_max_filesize is a PHP configuration directive, not a WordPress memory constant. WP_MEMORY_LIMIT can help with a separate memory or image-processing problem, but it does not raise the server’s individual-file upload limit.
Set post_max_size higher than upload_max_filesize so the complete request has room for the file and form data. For a 128 MB upload limit, 160M is a practical example, provided your hosting environment allows that value.
Check the current values in Site Health, then change upload_max_filesize and a higher post_max_size in DirectAdmin PHP Settings. If the panel supports local configuration, use php.ini or .user.ini; use .htaccess only when the active PHP mode supports php_value directives.
The file may be in the wrong document root, may not be read by the active PHP mode, or may be overridden by a server-level value. Confirm the domain and PHP version in DirectAdmin, recheck Site Health, and ask the hosting provider to confirm the account-level limit if the value remains unchanged.
Compare zoho mail alternatives for Indian businesses by rupee cost, IMAP access and mailbox limits,…
Compare Wix alternatives for Indian small businesses: see 3-year rupee costs, WordPress hosting, migration limits,…
Titan email price in India explained with mailbox costs, features, team totals and a comparison…
HostKarle vs Bluehost compares Indian shared hosting prices, renewal bills, email, SSL, backups, panels and…
Learn how to write blog in hindi with WordPress, Hindi typing tools, domain and hosting…
Compare Google Workspace alternatives in India by yearly rupee cost, email features and migration effort…
This website uses cookies.