Increasing the upload_max_filesize

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:
/etc/php5/apache2/php.ini /etc/php5/cli/php.ini /etc/php5/fpm/php.ini /etc/php5/cgi/php.ini
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. ; http://php.net/upload-max-filesize upload_max_filesize = 2M
and replace it with a higher value, for example:
; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize 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
Done! Try the upload again.
If this article helped you solve the problem then please leave a comment
Thanks for reading!