thumb 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

Step 1. Connect to the terminal of your web sever.

Step 2. Locate the php.ini filer:

sudo find / -name "php.ini"

Examples of output:


Step 3. Open a php.ini file:

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

Step 4. 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).

Step 5. Restart your web server:

For Apache:

sudo service apache2 restart

or Nginx:

sudo service nginx restart

Done! Try the upload again.

Arthur Gareginyan

Arthur Gareginyan

Arthur is a designer and full stack software engineer. He is the founder of His personal website can be found at Check out his free WordPress plugins at

Follow Arthur: