No results found. Try again with different words?

Search must be at least 3 characters.

Uploaded file exceeds the upload_max_filesize directive in php.ini

Sidebar Image

Did not find a solution? We are here to help you succeed.

Most hosting providers set limits to the PHP memory for running applications. The uploaded file exceeds the upload_max_filesize directive in php.ini is an error that occurs on your WordPress website when you upload a file that exceeds the limitations set by your web server.

How to Fix the upload_max_filesize Error

As you might have guessed, the solution involves increasing the default limit of upload_max_filesize. Letโ€™s look closely at it and see what steps we can take to fix this error.

Method 1. Editing the .htaccess File

  • Login to CPanel and navigate to File Manager under the Files section.
  • Locate the .htaccess file and right-click to Edit.
  • Add the following line at the bottom of the file and Save the changes.
php_value upload_max_filesize 256M

Method 2. Editing the wp-config.php File

Another way to fix the uploaded file exceeding the upload_max_filesize directive in php.ini error is by tweaking the wp-config.php file in your root directory.

For that, log in to the CPanel and access public_html to edit the wp_config. php file. Add the following line before the โ€œThatโ€™s all, stop editing! Happy publishingโ€ line:

@ini_set('upload_max_size' , '256M' );

Once you add the code, Save the file, refresh your web browser, and try uploading again!

Method 3. Updating php.ini to Fix the upload_max_filesize Error

If you wish, you can always modify your PHP settings through the PHP Configuration tool on CPanel.

If youโ€™re using VPS or a different platform, you can try updating php.ini to fix the error. Hereโ€™s what you need to do:

  • Navigate to your php.ini file and edit it. If you canโ€™t find it, ask for assistance from your hosting providers.
  • Locate the upload_max_filesize and increase it by changing its number. You can also boost a few other limitations, as shown below:
upload_max_filesize = 256M 
post_max_size = 256M 
memory_limit = 512M 
max_execution_time = 180

Save the file, and thatโ€™s it. The error should no longer occur.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form