Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix the upload_max_filesize Error in WordPress

This guide helps you fix the message "The uploaded file exceeds the upload_max_filesize directive in php.ini".

WordPress2 min read13 steps10 screenshots

What does the error mean?

When you upload a picture, theme or plugin, the server checks its size. PHP is the language WordPress runs on. It has a setting named upload_max_filesize. This is the biggest file you may upload. If your file is bigger, you see the error. It is like a lift with a weight limit.

A second setting, post_max_size, limits the total data sent in one go. It should be at least as big as the upload limit.

Tip: Take a backup before you edit files. Your hosting plan may cap these limits. If a method does not work, ask Hostvento support.

Method 1: Use the control panel

Your control panel may have a PHP settings tool. Its name differs by panel, for example MultiPHP INI Editor or Select PHP Version.

  1. Log in to your hosting control panel.
  2. Look for the PHP settings tool.
    Screenshot: Look for the PHP settings tool.
  3. Find upload_max_filesize.
    Screenshot: Find upload_max_filesize .
  4. Change it to a bigger value, such as 64M. The M stands for megabytes.
  5. Find post_max_size and set it to 64M or more.
  6. Click Save.

Method 2: Edit .user.ini

A .user.ini file holds PHP settings for your folder.

  1. Open File Manager in your control panel.
    Screenshot: Open File Manager in your control panel.
    Screenshot: Open File Manager in your control panel.
  2. Go to the folder where WordPress is installed, often public_html.
  3. Create a file named .user.ini, or open it if it exists.
    Screenshot: Create a file named .user.ini , or open it if it exists.
    Screenshot: Create a file named .user.ini , or open it if it exists.
  4. Add the lines below.
  5. Save the file. It may take a few minutes to take effect.
    Screenshot: Save the file. It may take a few minutes to take effect.
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

These lines raise the file size limits and give the upload more time to finish.

Method 3: Edit .htaccess

This works on servers that run PHP as an Apache module. If it gives a 500 error, remove the lines again.

php_value upload_max_filesize 64M
php_value post_max_size 64M

Add these lines at the bottom of the .htaccess file. Download a copy of the file first.

Screenshot: Add these lines at the bottom of the .htaccess file. Download a copy of the file first.

Method 4: Upload by FTP

FTP moves files between your computer and your hosting account. If you only need to add a big theme or plugin, unzip it on your computer. Upload the folder to wp-content/themes or wp-content/plugins by FTP. Your FTP details are in your welcome email.

Check the new limit

  1. In WordPress, click Media, then Add New.
  2. Look under the upload box. It shows "Maximum upload file size".
    Screenshot: Look under the upload box. It shows "Maximum upload file size".

Quick recap

  • The error means your file is bigger than the PHP limit.
  • Raise upload_max_filesize and post_max_size.
    Screenshot: Raise upload_max_filesize and post_max_size .
  • Use the control panel, .user.ini or .htaccess.
  • Use FTP for big themes and plugins.
  • Ask support if your plan caps the limit.