Mostly there is a limit set to the PHP memory by web hosting providers to run applications and scripts. An error โthe uploaded file exceeds the upload_max_filesize directivein php.iniโ occurs on your WordPress website when the file you upload exceeds the limits set by the web server.
Though this error may seem to be scary, it has straight-forward solutions. In this tutorial, you will learn about fixing the error by increasing the default limit of upload_max_filesize using a few methods.
Methods to Fix the upload_max_filesize Error
Method 1. Edit the .htaccess File
Method 2. Edit the wp-config.php File
Method 3. Update php.ini
Method 4. Edit php.ini File Through cPanel
Method 5. Contact MilesWebโs Customer Support
Method 1. Edit the .htaccess File
The quick method to fix the error โthe uploaded file exceeds the upload_max_filesize directive in php.iniโ is to increase your PHP resource limits by modifying the .htaccess file. It can be done as below:
- Login to your cPanel and go toย Files->File Manager.

- Find theย .htaccessย file and right-click on it toย Edit.

- A confirmation window for editing the file will pop-up, click onย Editย again.

- Include this line below the file:
php_value upload_max_filesize 256M

- Now,ย Saveย the changes.
- In this way, you can increase theย upload_max_filesizeย value that will automatically fix the error.
- Upload your file again and still the error occurs, increase the additional PHP limits by including the below lines into the .htaccess file:
php_value post_max_size 256M php_value memory_limit 512M php_value max_input_time 180 php_value max_execution_time 180
- Modify the PHP limits to your preferred values until your web hosting provider supports it. Moreover, find the maximum available limits by checking the PHP info of your website.
Method 2. Edit the wp-config.php File
- The second method to get rid of this error is by modifying theย wp-config.phpย file located in your root directory.
- Just log in to the cPanel, go toย public_htmlย and search for theย wp_config. phpย file. Right-click on the file and click onย Edit.

- A confirmation window for editing the file will pop-up, click onย Editย again.

- Include the below line before theย โThatโs all, stop editing! Happy publishingโย line:
@ini_set('upload_max_size' , '256M' );

- Thenย Save Changesย toย the file, refresh your web browser and try to upload it again.
Method 3. Update php.ini
When you keenly check uploaded file exceeds the upload_max_filesize directive in php.ini error message, you can assume that there is something related to php.ini, a file that comprises of all of the PHP related variables.
On a shared server of MilesWeb, you can modify it by altering php.ini.
- In terms of VPS or a different platform, try to updateย php.iniย to fix the error.
- Go to yourย php.iniย file, right-click on it and click onย Editย it. In case you donโt find it, ask for help from your hosting providers.

- Find theย upload_max_filesizeย and increase it by modifying its number. You can also increase a few other limitations, as below:
upload_max_filesize = 256M post_max_size = 256M memory_limit = 512M max_execution_time = 180
- Now,ย Saveย the file and the error should no longer exist.
Method 4. Edit php.ini File Through cPanel
If your web host has offered you cPanel, you can easily edit the php.ini file and upload_max_filesize directive via the cPanel dashboard.
- Go toย MultiPHP INI Editorย underย Softwareย section.

- Select your WordPress website from the dropdown and edit theย upload_max_filesizeย directive as below and click onย Apply:

You can increase the value based on your requirements.
Method 5. Contact MilesWebโs Customer Support
If none of above options helps in fixing the error and you are a customer of MilesWeb, contact their customer support team.
You can explain them the situation and the steps you followed to fix the error. They will resolve the problem for you.
You can contact MilesWebโs support team at any time. There are two contact options: email and live chat.
Conclusion
Hopefully, you will able to resolve the upload_max_filesize error with the above methods.
Also Read


