User Tools

Site Tools


php:increase_the_upload_max_filesize

This is an old revision of the document!


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

NOTE: Restart any programs that depend on php.

For example, NginX or Apache.

php/increase_the_upload_max_filesize.1591736646.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki