Table of Contents

PHP - Increase the upload_max_filesize

The default upload file size for PHP is 2 MB, which is a problem if you want to upload a files that is bigger.

Locate the php.ini file

sudo find / -name "php.ini"

returns:

/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini
/etc/php5/fpm/php.ini
/etc/php5/cgi/php.ini

Modify each ini file

Find the line upload_max_filesize = 2M.

Change it to a higher value, for example:

php.ini
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 10M

IMPORTANT: Restart any programs that depend on php.

For example, NginX or Apache.