User Tools

Site Tools


php:increase_the_upload_max_filesize

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.

php/increase_the_upload_max_filesize.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki