The default upload file size for php (and, consequently, for WordPress) is 2 MB, which is a problem if you want to upload a files that’s bigger. Follow these steps if you get this message:

The uploaded file exceeds the upload_max_filesize directive in php.ini

Connect to the terminal of your web sever.

Locate the php.ini filer:

sudo find / -name "php.ini"

Examples of output:


Open a php.ini file:

sudo nano /etc/php5/apache2/php.ini

Find the line upload_max_filesize = 2M by using Ctrl+W key combination.

That’s it:

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

and replace it with a higher value, for example:

; Maximum allowed size for uploaded files.
upload_max_filesize = 10M

Save the changes to the file (press Ctrl+O to write out and Ctrl+X to exit).

Restart your web server:

For Apache:

sudo service apache2 restart

or Nginx:

sudo service nginx restart

Try the upload again.


That’s it, you’re done. So simple isn’t it?

If you are having trouble fixing this problem with the instructions above, but are being able to solve this problem with any another method please describe it in the comment section below. Thanks!

If this article has helped you solve the problem then please leave a comment :smiley:

Thanks for reading!